title: Last Insert ID is NULL in Laravel
body: <p>I'm trying to get the last insert ID like so:</p>
  
  <pre><code>$leadData = [
              'first_name'        =&gt; $first_name,    
              'last_name'         =&gt; $last_name,
              'phone_number'      =&gt; $phone_number,  
              'company'           =&gt; $company,     
              'email_address'     =&gt; $email_address, 
              'iso_code'          =&gt; $iso_code,     
              'product'           =&gt; $product,       
              'transaction_id'    =&gt; $transaction_id,
              'rep_name'          =&gt; $rep_name,
              'ip_address'        =&gt; $ip_address
          ];
  
          //insert lead into DB
          $lead = new Lead();
          $lead-&gt;create($leadData);
          //dd($lead);
          $leadId = $lead-&gt;id;
          dd($leadId);
  </code></pre>
  
  <p>but $leadId is NULL every time. My record is being inserted correctly into the MySQL table. Its a seemingly stupid problem, but has had me stumped for the last hour.</p>
  
  <p>How could $leadID possibly be null?</p>