title: Laravel get all related models for multiple models
body: <p>I have a users table and a groups table. 
  I have set up a many to many users/groups relations. 
  When I run </p>
  
  <pre><code>$users = User::where("id",'=',6)-&gt;first()-&gt;groups;
  </code></pre>
  
  <p>,I get the right group. </p>
  
  <p>But I will have cases where my queries will take in an array of users. 
  How do I get all the groups of all those users using laravel relationships ?</p>