title: Laravel Eloquent Join vs Inner Join?
body: <p>So I am having some trouble figuring out how to do a feed style mysql call, and I don't know if its an eloquent issue or a mysql issue. I am sure it is possible in both and I am just in need of some help. </p>
  
  <p>So I have a user and they go to their feed page, on this page it shows stuff from their friends (friends votes, friends comments, friends status updates). So say I have tom, tim and taylor as my friends and I need to get all of their votes, comments, status updates. How do I go about this? I have a list of all the friends by Id number, and I have tables for each of the events (votes, comments, status updates) that have the Id stored in it to link back to the user. So how can I get all of that information at once so that I can display it in a feed in the form of. </p>
  
  <p>Tim commented "Cool"</p>
  
  <p>Taylor Said "Woot first status update~!"</p>
  
  <p>Taylor Voted on "Best competition ever"</p>
  
  <p>Edit @damiani
  So after doing the model changes I have code like this, and it does return the correct rows</p>
  
  <pre><code>$friends_votes = $user-&gt;friends()-&gt;join('votes', 'votes.userId', '=', 'friend.friendId')-&gt;orderBy('created_at', 'DESC')-&gt;get(['votes.*']);
  $friends_comments = $user-&gt;friends()-&gt;join('comments', 'comments.userId', '=', 'friend.friendId')-&gt;orderBy('created_at', 'DESC')-&gt;get(['comments.*']);
  $friends_status = $user-&gt;friends()-&gt;join('status', 'status.userId', '=', 'friend.friendId')-&gt;orderBy('created_at', 'DESC')-&gt;get(['status.*']);
  </code></pre>
  
  <p>But I would like them all to happen at once, this is because mysql sorting thousands of records in order is 100x faster then php taking 3 lists, merging them and then doing it. Any ideas?</p>