title: "SQLSTATE[23000]: Integrity constraint violation: 1048 Column laravel
body: <p>I am trying to post some data just to test the api if it working or not. Fortunately it's not working. project is connected with the database . It's working fine when I fetch the data but not working when I post the data.</p>
  <p>&quot;message&quot;: &quot;SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null (SQL: insert into <code>employees</code> (<code>name</code>, <code>address</code>, <code>updated_at</code>, <code>created_at</code>) values (?, ?, 2022-01-24 17:49:27, 2022-01-24 17:49:27))&quot;,</p>
  <pre><code>public function up()
      {
          Schema::create('employees', function (Blueprint $table) {
              $table-&gt;id();
              $table-&gt;string('name');
              $table-&gt;string('address');
              $table-&gt;timestamps();
          });
      }
  
    public function store(Request $req)
      {
          //
         $employee = new Employee;
         $employee-&gt;name = $req-&gt;name;
         $employee-&gt;address=$req-&gt;address;
         $employee-&gt;save();
      }
  
  Route::apiResource('/employee', App\Http\Controllers\EmployeeController::class);
  </code></pre>