title: getting the relation data from where clause in view
body: <p>I have the following query</p>
  
  <pre><code>        $partner = DeliveryPartner::with(['deliveryPartnerImage' =&gt; function($q) {
          $q-&gt;where('image_type', '=', 'logo');
      }])
          -&gt;find($id);
  </code></pre>
  
  <p>this works. for a partner with a logo it shows a relation with 1 item like so</p>
  
  <p><a href="https://i.stack.imgur.com/SO1CL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SO1CL.png" alt="enter image description here"></a></p>
  
  <p>and when i change the where clause to something non existent for example <code>$q-&gt;where('image_type', '=', 'testtesttest');</code></p>
  
  <p>it shows a empty array like this</p>
  
  <p><a href="https://i.stack.imgur.com/KQzqB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KQzqB.png" alt="enter image description here"></a></p>
  
  <p>so i know my query works but how to get this data in the view?</p>
  
  <p>i did <code>$partner-&gt;deliveryPartnerImage()-&gt;first()</code> But for some reason this always shows data? also when i change the query... so im guessing im doing this wrong but i can not find another way to do this?</p>