title: Laravel 4 Migration - Cannot add foreign key constraint
body: <p>Here's my migration code:</p>
  
  <pre><code>public function up()
  {
      Schema::create('foos', function(Blueprint $table) {
          // Primary key
          $table-&gt;increments('id');
  
          // Standard
          $table-&gt;engine = 'InnoDB';
          $table-&gt;timestamps();
          $table-&gt;softDeletes();
      });
  
      Schema::create('bars', function(Blueprint $table) {
          // Primary key
          $table-&gt;increments('id');
  
          // Define foreign key
          $table-&gt;integer('foo_id')-&gt;unsigned;
  
          // Foreign key contraints
          // NOTE: causes "General error: 1215 Cannot add foreign key constraint"
          // $table-&gt;foreign('foo_id')-&gt;references('id')-&gt;on('foos');
  
          // Standard
          $table-&gt;engine = 'InnoDB';
          $table-&gt;timestamps();
          $table-&gt;softDeletes();
      });
  }
  
  public function down()
  {
      Schema::drop('foos');
      Schema::drop('bars');
  }
  </code></pre>
  
  <p>When the code to define the foreign key constraint is not commented out, I get the following error on the command line: <strong>General error: 1215 Cannot add foreign key constraint</strong>.</p>
  
  <p>Any ideas what I am doing wrong?</p>