bigIncrements('id'); $table->unsignedInteger('album_id')->nullable(); $table->unsignedBigInteger('photo_id')->nullable(); $table->unsignedInteger('user_id')->nullable(); $table->string('view_style')->nullable(); $table->timestamp('hit_at'); $table->string('ip_address'); $table->string('user_agent'); $table->string('session_identifier'); $table->string('uri', 500); $table->foreign('album_id') ->references('id')->on('albums') ->onDelete('no action'); $table->foreign('photo_id') ->references('id')->on('photos') ->onDelete('no action'); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('no action'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('visitor_hits'); } }