Laravel Tips: Unsigned Integer [2]

For foreign key migrations instead of ​integer()​ use ​unsignedInteger()​ type or integer()->unsigned()​, otherwise you may get SQL errors.

Schema::create('employees', function (Blueprint $table) {
     $table->​unsignedInteger​('company_id');
     $table->foreign('company_id')->references('id')->on('companies');
     // ... 
});

You can also use ​unsignedBigInteger()​ if that other column is ​bigInteger()​ type.

Schema::create('employees', function (Blueprint $table) {
     $table->​unsignedBigInteger​('company_id'); 
});