title: laravel change nullable column to no nullable in foreign key
body: <p>This is my migration:</p>
  
  <pre><code>        $table-&gt;increments('id');
          $table-&gt;string('nombre1',255);
          $table-&gt;string('nombre2',255)-&gt;nullable();
          $table-&gt;string('apellido1',255)-&gt;nullable();
          $table-&gt;string('apellido2',255)-&gt;nullable();
          $table-&gt;string('apellido_casada',255)-&gt;nullable();
          $table-&gt;string('cedula',255)-&gt;nullable();
          $table-&gt;integer('entidad_id')-&gt;nulleable()-&gt;unsigned();
          **$table-&gt;integer('cargo_id')-&gt;nulleable()-&gt;unsigned();
          $table-&gt;integer('partido_id')-&gt;nulleable()-&gt;unsigned();
          $table-&gt;integer('provincia_id')-&gt;nulleable()-&gt;unsigned();
          $table-&gt;integer('distrito_id')-&gt;nulleable()-&gt;unsigned();
          $table-&gt;integer('corregimiento_id')-&gt;nulleable()-&gt;unsigned();**
          $table-&gt;string('otro_nombre',255)-&gt;nullable();
          $table-&gt;dateTime('fecha_nacimiento')-&gt;nullable();
          $table-&gt;timestamps();
          $table-&gt;softDeletes();
          $table-&gt;foreign('entidad_id')-&gt;references('id')-&gt;on('entidad');
          $table-&gt;foreign('cargo_id')-&gt;references('id')-&gt;on('cargo');
          $table-&gt;foreign('partido_id')-&gt;references('id')-&gt;on('partido');
          $table-&gt;foreign('provincia_id')-&gt;references('id')-&gt;on('provincia');
          $table-&gt;foreign('distrito_id')-&gt;references('id')-&gt;on('distrito');
          $table-&gt;foreign('corregimiento_id')-&gt;references('id')-&gt;on('corregimiento'); 
  </code></pre>
  
  <p>When i run this migration the table generated is:</p>
  
  <pre><code>    CREATE TABLE pep (
      id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
      nombre1 VARCHAR(255) COLLATE UTF8_UNICODE_CI NOT NULL,
      nombre2 VARCHAR(255) COLLATE UTF8_UNICODE_CI DEFAULT NULL,
      apellido1 VARCHAR(255) COLLATE UTF8_UNICODE_CI DEFAULT NULL,
      apellido2 VARCHAR(255) COLLATE UTF8_UNICODE_CI DEFAULT NULL,
      apellido_casada VARCHAR(255) COLLATE UTF8_UNICODE_CI DEFAULT NULL,
      cedula VARCHAR(255) COLLATE UTF8_UNICODE_CI DEFAULT NULL,
      **entidad_id INT(10) UNSIGNED NOT NULL,
      cargo_id INT(10) UNSIGNED NOT NULL,
      partido_id INT(10) UNSIGNED NOT NULL,
      provincia_id INT(10) UNSIGNED NOT NULL,
      distrito_id INT(10) UNSIGNED NOT NULL,
      corregimiento_id INT(10) UNSIGNED NOT NULL,**
      otro_nombre VARCHAR(255) COLLATE UTF8_UNICODE_CI DEFAULT NULL,
      fecha_nacimiento DATETIME DEFAULT NULL,
      created_at TIMESTAMP NULL DEFAULT NULL,
      updated_at TIMESTAMP NULL DEFAULT NULL,
      deleted_at TIMESTAMP NULL DEFAULT NULL,
      PRIMARY KEY (id),
      KEY pep_entidad_id_foreign (entidad_id),
      KEY pep_cargo_id_foreign (cargo_id),
      KEY pep_partido_id_foreign (partido_id),
      KEY pep_provincia_id_foreign (provincia_id),
      KEY pep_distrito_id_foreign (distrito_id),
      KEY pep_corregimiento_id_foreign (corregimiento_id),
      CONSTRAINT pep_cargo_id_foreign FOREIGN KEY (cargo_id)
          REFERENCES cargo (id),
      CONSTRAINT pep_corregimiento_id_foreign FOREIGN KEY (corregimiento_id)
          REFERENCES corregimiento (id),
      CONSTRAINT pep_distrito_id_foreign FOREIGN KEY (distrito_id)
          REFERENCES distrito (id),
      CONSTRAINT pep_entidad_id_foreign FOREIGN KEY (entidad_id)
          REFERENCES entidad (id),
      CONSTRAINT pep_partido_id_foreign FOREIGN KEY (partido_id)
          REFERENCES partido (id),
      CONSTRAINT pep_provincia_id_foreign FOREIGN KEY (provincia_id)
          REFERENCES provincia (id)
  )  ENGINE=INNODB DEFAULT CHARSET=UTF8 COLLATE = UTF8_UNICODE_CI;
  </code></pre>
  
  <p>The problem is that some of the columns:  entidad_id, cargo_id, etc, are declared as NULL and when i set the FK, laravel created them as NOT NULL.</p>
  
  <p>Is anyting here that i am missing??</p>