title: Laravel Queue Breaks On Live Server Works Well on Local
body: <p>I need help with my Laravel App, the queue breaks (gives funny errors) on Digital Ocean server, but works perfectly well and fast on my local. The error on the server often changes from eloquent error to undefined variable.
  The error says "General error: 1364 Field 'user_id' doesn't have a default value..." 
  <a href="https://i.stack.imgur.com/QZd61.png" rel="nofollow noreferrer">here's an image of it</a></p>
  
  <p>However the value gets inputed just fine on my local.</p>
  
  <p>Here's the code</p>
  
  <pre><code>public function saveEmailsIntoDb($id)
  {
      $list = EmailList::where('job_id',$id)-&gt;first();
     $contents = file(public_path('files/'.$list-&gt;stored_file_name), FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
     foreach ($contents as $value) 
     {
          Email::create([
              'user_id'       =&gt; $list-&gt;user_id,
              'email_list_id' =&gt; $list-&gt;id,
              'email'         =&gt; $value
          ]);
      }
  
      $credits = count($contents);
      User::where('id',$list-&gt;user_id)-&gt;decrement('credits', $credits);
      unlink(public_path('files/'.$list-&gt;stored_file_name));
      EmailList::where('stored_file_name',$list-&gt;stored_file_name)
               -&gt;update(['is_deleted' =&gt; 1]);
      return $list-&gt;id;
  }
  </code></pre>
  
  <p>I run apache on my local, i have nginx configured on Digital Ocean.</p>
  
  <p>The code works once in a while (randomly), but give this error on most times. The queue driver is database.</p>