increments('id'); $table->timestamps(); $table->string('titre', 80); $table->text('contenu'); $table->integer('user_id')->unsigned(); $table->foreign('user_id') ->references('id') ->on('users') ->onDelete('restrict') ->onUpdate('restrict'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('posts', function(Blueprint $table) { $table->dropForeign('posts_user_id_foreign'); }); Schema::drop('posts'); } }