bigIncrements('id'); $table->unsignedInteger('user_id'); $table->unsignedInteger('recipe_id'); $table->foreign('user_id') ->references('id') ->on('users') ->onUpdate('cascade') ->onDelete('cascade'); $table->foreign('recipe_id') ->references('id') ->on('recipes') ->onUpdate('cascade') ->onDelete('cascade'); $table->timestamp('created_at'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('users_recipes'); } }