id('user_assignment_id'); $table->timestamps(); $table->foreignId('cinema_id')->constrained('cinemas', 'cinema_id'); $table->foreignId('user_id')->constrained('users', 'user_id'); $table->unique(['cinema_id', 'user_id']); // only one user per cinema }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('user_assignments'); } };