title: Laravel migration foreign key issue
body: <p>I have created categories table using categories migration and then i am trying to create products table using another migration with foreign key categories_id in products table to id in products table.</p>
  
  <p>Please find my migrations below.</p>
  
  <pre><code>Categories migration
  
  &lt;?php
  
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateCategoriesTable extends Migration {
  
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('categories',function(Blueprint $table)
          {
              $table-&gt;increments('id');
  
              $table-&gt;string('category_name', 255);
              $table-&gt;string('category_description', 255);
  
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::drop('categories');
      }
  
  }
  
  Products migration
  
  &lt;?php
  
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateProductsTable extends Migration {
  
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('products', function(Blueprint $table)
          {
              $table-&gt;increments('id');
              $table-&gt;integer('category_id')-&gt;unsigned();
              $table-&gt;foreign('category_id')-&gt;reference('id')-&gt;on('categories');
              $table-&gt;string('product_name');
              $table-&gt;text('product_description');
              $table-&gt;decimal('product_cost', 10, 2);
              $table-&gt;text('product_image');
              $table-&gt;boolean('product_availability')-&gt;default(1);
  
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::drop('products');
      }
  
  }
  </code></pre>
  
  <p>I am getting this below error when i ran php artisan migrate command in command line</p>
  
  <pre><code>[Illuminate\Database\QueryException]
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
  n your SQL syntax; check the manual that corresponds to your MySQL server v
  ersion for the right syntax to use near ')' at line 1 (SQL: alter table `pr
  oducts` add constraint products_category_id_foreign foreign key (`category_
  id`) references `categories` ())
  </code></pre>