id(); $table->foreignIdFor(Study::class)->constrained()->cascadeOnDelete(); $table->foreignIdFor(User::class)->nullable()->constrained()->nullOnDelete(); $table->timestamps(); $table->unique(['study_id', 'user_id']); }); } public function down(): void { Schema::dropIfExists('study_assignments'); } };