Larabel 7.X:
$table->foreignId("product_id"); $table->foreign("product_id")->references("id")->on("products"); $table->foreignId("shopping_carts_id"); $table->foreign("shopping_carts_id")->references("id")->on("shopping_carts"); $table->integer("amount")->default(1);