title: Using laravel eloquent relation to retrieve all records except NULL
body: <p>Is there a way to retrieve all the records which has not null using eloquent model. </p>
  
  <p>e.g. </p>
  
  <p>I have relation setup </p>
  
  <p>Plate model </p>
  
  <pre><code>public function project()
  {
      return $this-&gt;hasOne('App\Models\Project');
  }
  </code></pre>
  
  <p>project model </p>
  
  <pre><code>public function plate()
  {
      return $this-&gt;belongsTo('App\Models\Plate');
  }
  </code></pre>
  
  <p>How can I retrieve all the records which have value. </p>
  
  <p>trying this <code>return  $p = \App\Models\Plate::with('project')-&gt;get();</code></p>
  
  <p>will return everything, even those who have <code>NULL</code>. </p>
  
  <p><a href="https://i.stack.imgur.com/oyFw0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oyFw0.png" alt="enter image description here"></a></p>
  
  <p>All I want is <code>plates</code> which have projects attached to.  I tried laravel documentation, but could't find anything. Is there also same approach for <code>many</code> relations  </p>