title: Checking if record exists in Laravel not working
body: <p>i'm doing this to check if the record exists with chasis_number. if it doesn't exist insert data and if it does don't insert. but it's not working.</p>
  <pre><code>        $chunks = $insert_data-&gt;chunk(500);
              
          $owner = Owner::where('chasis_number', '=', request()-&gt;get('chasis_number'))-&gt;first();
          foreach ($chunks as $chunk)
          {
          if ($owner === null) {
                 Owner::insert($chunk-&gt;toArray());
            }
          }
  </code></pre>