This can be done. But you need another model to keep the relationship. see this post http://laravel.io/forum/03-04-2014-hasmanythrough-with-many-to-many?page=1#reply-25908
How about follows table that will create a record when one user starts following another user. Table structure can be like this:
follows: id | follower_id | followed_id | ...
Then you can search for all followers of a certain user this way:
select * from follows where followed_id = x
Now this may not be the best practice depending on your app, but just one way to do it.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community