title: Laravel Eloquent : Ignore null values on an return
body: <p>I would like to modify my eloquent query to get only json value where family.equipment is different than null.</p>
  
  <p>Here is my request:</p>
  
  <pre><code>$data = Ov::with([
      'name',
      'family.equipment' =&gt; function ($query) use ($model) {
          $query-&gt;where('model', 'like', $model)-&gt;orWhere('baseModel', 'like', $model);
      },
      'family.device.equipment' =&gt; function ($query) use ($model) {
          $query-&gt;where('model', 'like', $model)-&gt;orWhere('baseModel', 'like', $model);
      }
  ])-&gt;distinct()-&gt;get();
  </code></pre>
  
  <p>And the actual result:</p>
  
  <p>Return :</p>
  
  <pre><code>[
    {
      "name": [
        {
          "label": "LIC",
          "value": "@ew9Ddededezdzec"
        }
      ],
      "family": [
        {
          "name": "test1",
          "equipment": null,
          "device": []
        },
        {
          "name": "test2",
          "equipment": null,
          "device": []
        },
        {
          "name": "test3",
          "equipment": {
              'name': "test",
          }
          "device": []
        },
      ]
    },...
  ]
  </code></pre>