skip to Main Content

Laravel Basic BelongsToMany

I have ProductCollection Model and AttributeValue Model which have a common table product_collection_attributes that has 2 columns: product_collection_id and attribute_value_id that are a foreign key to their respective tables and are both a primary key. In ProductCollection Model relation is:…

VIEW QUESTION

how to make relationship between to table in laravel?

my database has two table games and teams, games migration: $table->unsignedBigInteger('homeTeam'); $table->unsignedBigInteger('awayTeam'); $table->foreign('homeTeam')->references('id')->on('teams') $table->foreign('awayTeam')->references('id')->on('teams') what is relationship between this two table? many to many? should I create "game_team" pivot table? i tried to change design of database but it don't…

VIEW QUESTION
Back To Top
Search