I have four tables
quotation
- id
item
- id
- quotation_id
article
- article_id
- quotation_id
articleItem
- pivot_item_id
- pivot_article_id
either articleItem have more columns
and i need right syntax of manyToMany relation between item and article
at the moment i have in item model
return $this->belongsToMany(Article::class,'articleItem','pivot_item_id','pivot_article_id','id','article_id');
i really dont know where to put quotation_id in this relation...
is it possible?
How is item related to article? Is an article assigned to an item or vice versa? More information would be helpful. Maybe give an example of what you are trying to achieve.
Many-to-many relationship is usually 3 tables such as users, roles, role_users. What you have looks similar to a polymorphic many-to-many with item and article sharing a relationship with quotation.