increments('id'); $table->timestamps(); $table->morphs('object'); $table->unsignedInteger('author_id')->index(); $table->text('message'); $table->foreign('author_id')->references('id')->on('users') ->onDelete('cascade'); // we can't add a foreign key constraint on the morph column, need to check manually }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('content_reports'); } }