foreignId('discount_id') ->constrained('discount') ->cascadeOnDelete(); $table->foreignId('customer_id') ->constrained('user') ->cascadeOnDelete(); $table->primary(['discount_id', 'customer_id']); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('discount_customer'); } };