本文介绍了获取我们关注的用户的提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

如何获取我们关注的用户的供稿/活动列表.

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

我尝试了$user_feed_1->following(10, 20);,但没有像我们进入$user_feed_1->getActivities(5, 10);

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

我正在使用Laravel框架.我没有任何错误,但是得到了输出 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)

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)

与提要不同的输出

推荐答案

如果要检索用户列表,而不要检索为其供稿创建的关注连接,则还应该将关注连接存储在数据库中.

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.

官方 laravel示例应用正是这样做的,它存储了用户之间的跟随连接并在创建或销毁这些连接时发送API调用.通过查看示例代码中的Follow模型,您可以了解到它是如何完成的.

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.

这篇关于获取我们关注的用户的提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 08:21