title: Add foreign Key to Existing Table Laravel 4
body: <p>I can´t added a foreign key to existing table, my first migration is: </p>
  
  <pre><code>public function up() {
      Schema::create('clases_inventario', function($t) {
                  $t-&gt;increments('id');
                  $t-&gt;integer('grupos_inventario_id');
                  $t-&gt;integer('laboratorio_id');
                  $t-&gt;string('codigo', 4);
                  $t-&gt;string('descripcion', 64);
                  $t-&gt;boolean('estado')-&gt;default(true);
                  $t-&gt;timestamps();
              });
  }
  </code></pre>
  
  <p>my second migration is to added the forein key is </p>
  
  <pre><code>public function up() {
  
          Schema::table('clases_inventario', function($table) {
                      $table-&gt;foreign('grupos_inventario_id')-&gt;references('id')-&gt;on('grupos_inventario');
                  });
      }
  </code></pre>
  
  <p>and i run <code>php artisan migration</code> and output next error </p>
  
  <pre><code> [Exception]
   SQLSTATE[HY000]: General error: 1005 Can't create table 'bd_e_soft.#sql-818
   _55' (errno: 150) (SQL: alter table `clases_inventario` add constraint clas
   es_inventario_grupos_inventario_id_foreign foreign key (`grupos_inventario_
   id`) references `grupos_inventario` (`id`)) (Bindings: array (
   ))
  </code></pre>