title: Laravel eloquent how to get the minimum value that is not NULL?
body: <p>This is the code in my <code>Product</code> model to get the minimum price value (one product can have multiple price)</p>
  
  <pre><code>public function getLowestAttribute ()
  {
      return $this-&gt;prices-&gt;min('price');
  }
  </code></pre>
  
  <p>But it will return <code>NULL</code> rather than the smallest integer if there is a <code>NULL</code>.</p>
  
  <p>Basically I want to achieve this: </p>
  
  <p><code>[1, NULL, 2]</code> returns <code>1</code></p>
  
  <p><code>[1, NULL, 0]</code> returns <code>0</code></p>
  
  <p>Any suggestion would be appreciated.</p>