engine = 'InnoDB'; $table->bigIncrements('id')->unsigned(); $table->bigInteger('commandes_id')->unsigned(); $table->bigInteger('produits_id')->unsigned()->nullable(); $table->integer('quantite')->nullable(); $table->float('prix_vente')->nullable(); $table->timestamps(); }); Schema::table('lignes_commandes', function (Blueprint $table) { $table->foreign('commandes_id')->references('id')->on('commandes')->onUpdate('cascade')->onDelete('cascade'); $table->foreign('produits_id')->references('id')->on('produits')->onUpdate('cascade')->onDelete('set null'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfexists('lignes_commandes'); } };