title: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed:
body: <p>Trying to create a to-do list app on laravel but when i try to click on the button the create a new to-do list i get this error:</p>
  
  <pre><code>SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: tasks.description (SQL: insert into "tasks" ("description", "user_id", "updated_at", "created_at") values (, 1, 2017-10-09 03:28:35, 2017-10-09 03:28:35))
  </code></pre>
  
  <p>Here is my controller:</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      use Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
  
      public function tasks()
      {
          return $this-&gt;hasMany(Task::class);
      }
  
      protected $fillable = [
          'name', 'email', 'password',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  }
  </code></pre>
  
  <p>Here is my model for tasks:</p>
  
  <p>
  
  <p>namespace App;</p>
  
  <p>use Illuminate\Database\Eloquent\Model;</p>
  
  <pre><code>class Task extends Model
  {
      public function user()
      {
          return $this-&gt;belongsTo(User::class);
      }
  
  }
  </code></pre>
  
  <p>here is the model for users:</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      use Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
  
      public function tasks()
      {
          return $this-&gt;hasMany(Task::class);
      }
  
      protected $fillable = [
          'name', 'email', 'password',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  }
  </code></pre>
  
  <p>Here is the view:</p>
  
  <pre><code>@extends('layouts.app')
  
  @section('content')
      &lt;div class="container"&gt;
          @if (Auth::check())
              &lt;h2&gt;Tasks List&lt;/h2&gt;
              &lt;a href="/task" class="btn btn-primary"&gt;Add new Task&lt;/a&gt;
              &lt;table class="table"&gt;
                  &lt;thead&gt;&lt;tr&gt;
                      &lt;th colspan="2"&gt;Tasks&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;@foreach($user-&gt;tasks as $task)
                      &lt;tr&gt;
                          &lt;td&gt;
                              {{$task-&gt;description}}
                          &lt;/td&gt;
                          &lt;td&gt;
  
                              &lt;form action="/task/{{$task-&gt;id}}"&gt;
                                  &lt;button type="submit" name="edit" class="btn btn-primary"&gt;Edit&lt;/button&gt;
                                  &lt;button type="submit" name="delete" formmethod="POST" class="btn btn-danger"&gt;Delete&lt;/button&gt;
                                  {{ csrf_field() }}
                              &lt;/form&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
  
  
                  @endforeach&lt;/tbody&gt;
              &lt;/table&gt;
          @else
              &lt;h3&gt;You need to log in. &lt;a href="/login"&gt;Click here to login&lt;/a&gt;&lt;/h3&gt;
          @endif
  
      &lt;/div&gt;
  @endsection
  </code></pre>
  
  <p>Can't seem to figure out the problem and google seems not to have an idea either.</p>