title: Get Laravel models filtering by many to many relationship
body: <p>I have this films database schema (only data related to the question):</p>
  
  <pre>
  <strong>persons</strong> <em>(yes, I used "persons" instead of "people"...)</em>
  id
  name
  
  <strong>roles</strong>
  id
  name
  
  <strong>roles_persons</strong>
  person_id
  role_id
  </pre>
  
  <p>And the corresponding models, defining a many to many relationship:</p>
  
  <pre class="lang-php prettyprint-override"><code>class Person extends Model
  {
      protected $table = 'persons';
  
      public function roles(){
          return $this-&gt;belongsToMany('App\Role', 'roles_persons')-&gt;withTimestamps();
      }
  }
  
  class Role extends Model
  {
      public function persons(){
          return $this-&gt;belongsToMany('App\Person', 'roles_persons')-&gt;withTimestamps();
      }
  }
  </code></pre>
  
  <p>Everything fine so far.</p>
  
  <p>One of the roles is "director".</p>
  
  <p>Now I want to add a "films" table, which has a foreign key with the id of a director (a person with the "director" role).</p>
  
  <pre>
  <strong>films</strong>
  id
  title
  director_person_id
  </pre>
  
  <p>In the create method of FilmsController, I'm trying to send to the view a list with the directors (in order to display a select input to choose one).</p>
  
  <p>Which is the right way to do that?</p>
  
  <pre class="lang-php prettyprint-override"><code>class FilmsController extends Controller
  {
      public function create()
      {
          $directorRole = Role::find('1');
  
          $directorsToChoose = Person::  ???
  
          return view('films.create')-&gt;with('directors', $directors);
      }
  }
  </code></pre>
  
  <p>I saw <a href="https://stackoverflow.com/questions/21378889">this related question</a> but I don't understand how to apply it in this case.</p>
  
  <p>Thank you.</p>