Flow method for all activities
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.
source to share