Flow method for all activities

I am using stream-laravel to add a stream, but I can see that it is configured to use the user. So how could I use the method to read every single action on the site?

+3


source to share


1 answer


It is quite common and easy to use a separate global feed alongside all the unique themes or user feeds in your app.

When adding actions to a feed, there is an optional parameter to indicate to Stream that the action should also be copied to one or more other feeds. See Targeting Using the TO Field in Documents.

The stream-laraval library supports this with a hook on the parent Eloquent: model ActivityTrait.activityNotify()

. Just return a one-off array containing the name of your global feed.



class MyActivity extends Eloquent {
  use GetStream\StreamLaravel\Eloquent\ActivityTrait;

public function activityNotify()
{
  return array('global_feed');
}

      

If you are looking for other examples, there is a Notice section in the README.md . In this case, there are individual notification feeds for each user, and they are received through FeedManager.getNotificationFeed()

. This way you have some flexibility.

+2


source







All Articles