Hi!!
I have a question for a Laravel Pivot Table:
I have two tables, one fot the "houses" and one for the "promotions"; this two table has a many to many relationship
Model house_promotion_table
public function up()
{
Schema::create('house_promotion', function (Blueprint $table) {
$table->id();
$table->foreignId('house_id')->constrained();
$table->foreignId('promotion_id')->constrained();
$table->timestamps();
});
}
I have created a different houses and a 3 types of "Promotions". Now i want to connect one of my houses with one of my type promotions, in a Pivot table.
I don't need to create a new House with a promotions inside; i need to take one of my houses and connect this with one of my promotions in another time.
Which is the best way for create a controller to store this in a Pivot table?
Thank you very much!