Get feeds of user whom we are following

蹲街弑〆低调 提交于 2019-12-13 05:29:04

问题


How to get the list of feeds/activities for users whom we are following.

I tried $user_feed_1->following(10, 20); but not getting feed data like we get in $user_feed_1->getActivities(5, 10);

I am using Laravel framework. I am not getting any error but getting output array(size=4) 'created_at' =>string'2016-04-29T04:14:49.416Z'(length=24) 'feed_id' =>string'flat:1986'(length=9) 'target_id' =>string'user:6028'(length=9) 'updated_at' =>string'2016-04-29T04:14:49.416Z'(length=24)

Not the output as for feed


回答1:


If you want to retrieve the list of users, and not the follow connections created for their feeds, you should store the follow connections in your database as well.

The official laravel example apps does exactly this, it stores follow connections between users and sends API calls whenever those connections are created or destroyed. You can see how that's done by looking at the Follow model in the code of the example.



来源:https://stackoverflow.com/questions/36930149/get-feeds-of-user-whom-we-are-following

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!