اول یه ماگریشن درست میکنیم:
php artisan make:migration create_foreign_key_for__table --table=products
حالا داخل ماگریشن کد زیر زیر مینزیم:
Schema::table('products', function (Blueprint $table) {
$table->integer('user_id')->unsigned()->change();
$table->foreign('user_id')->references('id')->on('users');
});
و در آخر :
php artisan migrate