title: Laravel - General error: 1366 Incorrect integer value
body: <p>When I try to save or update a model, I get an error that is below, for the field spid_id. I am not sure what is wrong.</p>
  
  <blockquote>
    <p>General error: 1366 Incorrect integer value: '' for column 'spid_id'
    at row 1 (SQL: update <code>magazines</code> set <code>spid_id</code> = , <code>updated_at</code> =
    2016-10-21 08:28:46, <code>summary</code> = where <code>id</code> = 8)</p>
  </blockquote>
  
  <p>This is how my table looks:</p>
  
  <pre><code>       Schema::create('magazines', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('name');
              $table-&gt;string('visual_id')-&gt;nullable();
              $table-&gt;integer('spid_id')-&gt;nullable();
              $table-&gt;timestamps();
          }); 
  </code></pre>
  
  <p>I tried to change my spid_id to not be nullable in the DB, by making a migration, because I thought that might be a reason:</p>
  
  <pre><code>        Schema::table('magazines', function (Blueprint $table) {
              $table-&gt;integer('spid_id')-&gt;change();
          });
  </code></pre>
  
  <p>But the field still remained nullable.</p>
  
  <p>This is my store function for create form:</p>
  
  <pre><code>        $magazine = Magazine::create([
            'name' =&gt; $request-&gt;input('name'),
            'visio_link_prefix' =&gt; $request-&gt;input('visio_link_prefix'),
            'spid_id' =&gt; $request-&gt;input('spid_id'),
            'summary' =&gt; $request-&gt;input('summary'),
          ]);
  </code></pre>