bigIncrements('id'); $table->unsignedInteger('user_id'); $table->dateTime('activity_at'); $table->string('type', 100); $table->unsignedBigInteger('photo_id')->nullable(true); $table->unsignedBigInteger('photo_comment_id')->nullable(true); $table->timestamps(); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('cascade'); $table->foreign('photo_id') ->references('id')->on('photos') ->onDelete('cascade'); $table->foreign('photo_comment_id') ->references('id')->on('photo_comments') ->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('user_activity'); } }