title: Laravel foreign key saves issue
body: <p>I have table named <code>companies</code> and other table named <code>ads</code>, I try to get company id in ads column named <code>company_id</code>.</p>
  
  <p>This is my ads migration:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateAdTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('ads', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;integer('company_id')-&gt;unsigned();
              $table-&gt;string('title')-&gt;unique();
              $table-&gt;string('slug')-&gt;unique();
              $table-&gt;string('image')-&gt;nullable();
              $table-&gt;string('description');
              $table-&gt;timestamps();
          });
  
          Schema::table('ads', function($table) {
              $table-&gt;foreign('company_id')-&gt;references('id')-&gt;on('companies')-&gt;onDelete('cascade');
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('ads');
      }
  }
  </code></pre>
  
  <p>this will create me ads table with no problem but when i try to save ads it returns me this error:</p>
  
  <pre><code>SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`jobid`.`ads`, CONSTRAINT `ads_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`)) (SQL: insert into `ads` (`title`, `slug`, `description`, `image`, `updated_at`, `created_at`) values (first ad test, first-ad-test, &lt;p&gt;rwv R4QF Q4R&lt;/p&gt;, 1494998776.png, 2017-05-17 12:26:17, 2017-05-17 12:26:17))
  </code></pre>
  
  <p>How can I fix that?</p>
  
  <p>UPDATE</p>
  
  <pre><code>public function up()
      {
          Schema::create('companies', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('company_name');
              $table-&gt;string('manager_name');
              $table-&gt;string('username')-&gt;unique();
              $table-&gt;string('email')-&gt;unique();
              $table-&gt;string('image')-&gt;nullable();
              $table-&gt;string('password');
              $table-&gt;text('about')-&gt;nullable();
              $table-&gt;rememberToken();
              $table-&gt;timestamps();
          });
      }
  </code></pre>
  
  <p>Store function</p>
  
  <pre><code>  public function store(Request $request)
    {
      $this-&gt;validate($request, array(
        'title' =&gt; 'required|max:255',
        'slug' =&gt; 'required|alpha_dash|min:5|max:255|unique:ads,slug',
        'image' =&gt; 'sometimes|image',
        'description' =&gt; 'required'
      ));
  
      $ad = new Ad;
  
      $ad-&gt;title = $request-&gt;input('title');
      $ad-&gt;slug = $request-&gt;input('slug');
      $ad-&gt;description = $request-&gt;input('description');
  
  
      if ($request-&gt;hasFile('image')) {
        $avatar = $request-&gt;file('image');
        $filename = time() . '.' . $avatar-&gt;getClientOriginalExtension();
        $location = public_path('ads/');
        $request-&gt;file('image')-&gt;move($location, $filename);
  
  
        $ad-&gt;image = $filename;
      }
  
      $ad-&gt;save();
  
  
        Session::flash('success', 'Your ad published successfully!');
  
        return redirect()-&gt;route('company.adslist', $ad-&gt;id);
    }
  </code></pre>