id('ticket_id'); $table->timestamps(); $table->foreignId('order_id')->constrained('orders', 'order_id'); $table->foreignId('showing_id')->constrained('showings', 'showing_id'); $table->foreignId('seat_id')->constrained('seats', 'seat_id'); $table->foreignId('price_id')->constrained('prices', 'price_id'); $table->foreignId('user_id')->constrained('users', 'user_id'); $table->unique(['order_id', 'showing_id', 'seat_id']); // only one ticket per seat per showing per order }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('tickets'); } };