title: Laravel 5.8 Eloquent check if record exists
body: <p>Trying to check if <code>record</code> exists in <code>Purchase</code> class. </p>
  
  <p>When returning <code>$checker</code> it returns me <code>null</code> however when I use it inside <code>if else</code> it gives me <code>Has data</code>.</p>
  
  <p>Here's my code:</p>
  
  <pre class="lang-php prettyprint-override"><code>$checker = Purchase::select('id')-&gt;where('id',$request-&gt;itemid)-&gt;get();
  if ($checker === null){
      echo "None data";
  } else {
      echo "Has data";
  }
  </code></pre>