title: Check if database exists using Laravel
body: <p>I am trying to write a changelog using Laravel and have been asked to pull data from a MySQL database into an array; check in the array if an account ID exists based on values read in from JSON files.</p>
  <p>If not present, I need to create it and add the data to the array.</p>
  <p>The code I have at the moment adds entries to the database, but it does not do any sort of checking, my code is as follows:</p>
  <pre><code>if (isset($cfi-&gt;awsAccountId)) {
      $aid = new Account;
      $aid-&gt;aws_account_id = $cfi-&gt;awsAccountId;              
      $aid-&gt;save();
  }
  </code></pre>