Laravel 4 Migration has syntax error when adding Foreign Key <p>I'm trying to create a pivot table to hold some relationship data for some basic ACL functionality.</p> <p>The migration class:</p> <pre><code>Schema::create('group_user', function($table) { $table-&gt;increments('id'); $table-&gt;unsignedInteger('group_id'); $table-&gt;unsignedInteger('user_id'); $table-&gt;timestamps(); $table-&gt;softDeletes(); }); Schema::table('group_user', function($table) { $table-&gt;foreign('group_id') -&gt;reference('id')-&gt;on('groups'); $table-&gt;foreign('user_id') -&gt;reference('id')-&gt;on('users'); }); </code></pre> <p>After running the migration command, I get the following error:</p> <pre><code> [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at li ne 1 (SQL: alter table `group_user` add constraint group_user_group_id_foreign foreign key (`group_id`) references `groups` ()) </code></pre> <p>As you can see, the SQL syntax to add the foreign key constraint is missing the 'id' column name for the referenced table. Is this a bug in Laravel or is there something wrong with my schema code?</p>