id(); $table->string('nom'); $table->text('description')->nullable(); $table->foreignId('source_type_id')->constrained()->restrictOnDelete(); $table->foreignId('depot_id')->nullable()->constrained('depots')->nullOnDelete(); $table->string('cote')->nullable(); $table->string('auteur')->nullable(); $table->string('status')->default('a_faire'); // SourceStatus enum $table->timestamps(); }); Schema::create('source_user', function (Blueprint $table) { $table->foreignId('source_id')->constrained()->cascadeOnDelete(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->primary(['source_id', 'user_id']); }); } public function down(): void { Schema::dropIfExists('source_user'); Schema::dropIfExists('sources'); } };