title: laravel eloquent relationship with and where clause based on foreign column
body: <p>Hi I want to retrieve my <code>projects</code> held in a db which are owned by an auth <code>user</code> who  also creates <code>clients</code> (they have many projects and tasks) and <code>tasks</code> (belongs to a project and tasks and user).</p>
  
  <p>I want to retrieve all tasks that are not marked as closed in the status table, I know the id of this is 2 and I can retrieve this as so:</p>
  
  <pre><code>public function getOpenProjects() {
  
      return \Project::with(['clients', 'tasks', 'status'])
          -&gt;where('status_id', '!=', '2')
          -&gt;whereUserId(Auth::user()-&gt;id)
          -&gt;get();
  }
  </code></pre>
  
  <p>But how can I change this to query against a column in the statuses table, i.e. the name column in that table?</p>