title: How to filter many to many structure in Laravel
body: <p>I got a many to many user and role structure</p>
  
  <p><strong>users</strong><br>
  id<br>
  name</p>
  
  <p><strong>roles</strong><br>
  id<br>
  name</p>
  
  <p><strong>role_user</strong><br>
  user_id<br>
  role_id</p>
  
  <p><strong>Model</strong></p>
  
  <p><strong>User.php</strong>  </p>
  
  <pre><code>public function roles() {
      return $this-&gt;belongsToMany('Role');
  }
  </code></pre>
  
  <p><strong>Role.php</strong></p>
  
  <pre><code>public function users() {
      return $this-&gt;belongsToMany('User');
  }
  </code></pre>
  
  <p>There are two data <code>admins</code> and <code>members</code> in roles table, I would like to know to to filter users which role is admins.</p>