title: Laravel 5.8: Error Field doesn't have a default value
body: <p><strong>I saw similar questions but non of them work for me</strong>. This is the <code>Transition</code> model</p>
  
  <pre><code>class Transition extends Model
  {
   protected $fillable = ['origin_x', 'origin_y', 'destination_x', 'destination_y', 'freight_id', 'status', 'receiver_name', 'receiver_mobile', 'receiver_address'];
   protected $table = 'freight_transitions';
  }
  </code></pre>
  
  <p>and this is the insertion code</p>
  
  <pre><code>    $transition = Transition::create([
          'origin_x' =&gt; $redis['origin_x'],
          'origin_y' =&gt; $redis['origin_y'],
          'destination_x' =&gt; $redis['destination_x'],
          'destination_y' =&gt; $redis['destination_y'],
          'freight_id' =&gt; $freight-&gt;id,
          'status' =&gt; 2,
          'receiver_name' =&gt; $redis['receiver_name'],
          'receiver_mobile' =&gt; $redis['receiver_mobile'],
          'receiver_address' =&gt; $redis['receiver_address']
      ]);
  </code></pre>
  
  <p>I am sure the array of $redis` has value. But this is the error</p>
  
  <blockquote>
    <p>General error: 1364 Field 'origin_x' doesn't have a default value (SQL: insert into <code>freight_transitions</code> (<code>updated_at</code>, <code>created_at</code>) values (2019-11-02 16:42:58, 2019-11-02 16:42:58))</p>
  </blockquote>
  
  <p>From what I see, the Laravel does not try to insert the <code>origin_x</code> and other fields in to the DB. it only inserts the <code>created_at</code> and <code>updated_at</code>. I have a similar model called <code>Freight</code>, in a few lines above this code, I insert records in the same way with no error. But I don't know why it only inserts the  <code>created_at</code> and <code>updated_at</code>.</p>
  
  <p>I also tried</p>
  
  <pre><code>$transition = new Transition([....]);//array of above data
  $transition-&gt;save();
  </code></pre>
  
  <p>It also generates the same error.</p>
  
  <p>This is the migration</p>
  
  <pre><code>    Schema::create('freight_transitions', function (Blueprint $table) {
          $table-&gt;bigIncrements('id');
          $table-&gt;string('origin_x');
          $table-&gt;string('origin_y');
          $table-&gt;string('destination_x');
          $table-&gt;string('destination_y');
          $table-&gt;string('receiver_name')-&gt;nullable();
          $table-&gt;string('receiver_mobile')-&gt;nullable();
          $table-&gt;string('receiver_address')-&gt;nullable();
          $table-&gt;bigInteger('freight_id')-&gt;unsigned();
          $table-&gt;foreign('freight_id')-&gt;references('id')-&gt;on('freight_freights')-&gt;onDelete('cascade');
          $table-&gt;enum('status', ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14'])-&gt;default(1);//1: start
          $table-&gt;timestamps();
      });
  </code></pre>
  
  <p>and this is <code>redis</code> array in json format</p>
  
  <pre><code>{
  "origin_x": "555",
  "origin_y": "666",
  "destination_x": "777",
  "destination_y": "8888",
  "freight_type_id": "1",
  "title": null,
  "description": null,
  "price": 130000,
  "features": "2",
  "services": "2,5",
  "vehicle_id": 1,
  "token": "111111",
  "payment_type": "3",
  "user_id": 1,
  "receiver_name": null,
  "receiver_mobile": null,
  "receiver_address": null,
  "payment_status": 1,
  "status": 2
  }
  </code></pre>
  
  <p>Thanks in advance.</p>