title: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value in Laravel 6
body: <p>Here, I'm trying to to insert the data in the database but for some reason I am not able to insert the data in the database. This is the error:</p>
  
  <p>SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value (SQL: insert into <code>stages</code> (<code>code</code>, <code>name</code>, <code>description</code>, <code>updated_at</code>, <code>created_at</code>) values (32, dfs, vc, 2020-04-14 06:02:57, 2020-04-14 06:02:57))"</p>
  
  <p>My code are here:</p>
  
  <p>StageController.php</p>
  
  <pre><code>&lt;?php
  
  
  namespace App\Sys\Http\Controllers;
  
  use App\Http\Controllers\Controller;
  
  use Illuminate\Http\Request;
  
  use App\Sys\Model\Stage;
  
  class StageController extends Controller
  {
  
      public function index(Request $request)
      {  
          $per_page = $request-&gt;per_page ? $request-&gt;per_page : 5;
          $sort_by = $request-&gt;sort_by;
          $order_by = $request-&gt;order_by;
          return response()-&gt;json(['stages' =&gt; Stage::orderBy($sort_by, $order_by)-&gt;paginate($per_page)],200);
      }
  
      public function store(Request $request)
      {
          $location= Stage::create([
              'code' =&gt;$request-&gt;code,
              'name' =&gt;$request-&gt;name,
              'description' =&gt;$request-&gt;description
          ]);
          return response()-&gt;json(['stage'=&gt;$stage],200);
      }
  
  
      public function show($id)                                                                                                                                                           
      {
          $stages = Stage::where('code','LIKE', "%$id%")-&gt;orWhere('name','LIKE', "%$id%")-&gt;orWhere('description', 'LIKE', "%$id%")-&gt;paginate();
          return response()-&gt;json(['stages' =&gt; $stages],200);
      }
  
  
  
      public function update(Request $request, $id)
      {
         $stage = Stage::find($id);
         $stage-&gt;code  = $request-&gt;code;
         $stage-&gt;name  = $request-&gt;name;
         $stage-&gt;description  = $request-&gt;description;
         $stage-&gt;save(); 
         return response()-&gt;json(['stage'=&gt;$stage], 200);
      }
  
      public function destroy($id)
      {
          $stage = Stage::where('id', $id)-&gt;delete();
          return  response()-&gt;json(['stage'=&gt;$stage],200);
      }
  
      public function deleteAll(Request $request){
          Stage::whereIn('id', $request-&gt;stages)-&gt;delete();
          return response()-&gt;json(['message', 'Records Deleted Successfully'], 200);
      }
  }
  </code></pre>
  
  <p>Stage.php</p>
  
  <pre><code>&lt;?php
  
  namespace App\Sys\Model;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Stage extends Model
  {
      protected $guarded = [];
  }
  </code></pre>
  
  <p>My migration file:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Migrations\Migration;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Support\Facades\Schema;
  
  class CreateStagesTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('stages', function (Blueprint $table) {
              $table-&gt;uuid('id')-&gt;primary();
              $table-&gt;string('original_id',36)-&gt;default('0')-&gt;index();
              $table-&gt;string('code',10)-&gt;index()-&gt;nullable();
              $table-&gt;string('name',100);
              $table-&gt;string('description',200)-&gt;nullable();
              $table-&gt;char('created_by',36)-&gt;index();
              $table-&gt;char('edited_by',36)-&gt;index()-&gt;nullable();
              $table-&gt;timestamps();
  
              $table-&gt;foreign('created_by')-&gt;references('id')-&gt;on('users');
              $table-&gt;foreign('edited_by')-&gt;references('id')-&gt;on('users');
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('stages');
      }
  }
  </code></pre>