foreignIdFor(Student::class)->constrained()->cascadeOnDelete()->cascadeOnUpdate(); $table->foreignIdFor(Event::class)->constrained()->cascadeOnDelete()->cascadeOnUpdate(); // Doubler Specific Fields $table->integer('entry_count'); $table->foreignIdFor(Entry::class, 'accepted_entry')->nullable()->constrained()->cascadeOnDelete()->cascadeOnUpdate(); // Set the composite primary key $table->primary(['student_id', 'event_id']); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('doublers'); } };