A
A
akdes2017-06-09 18:30:20
MySQL
akdes, 2017-06-09 18:30:20

How to link a model to the pivot of two other models?

Good evening everyone.
There is a need to associate the model with a bunch (m: n) of the other two.
Models:
Container, Template, ContentList
Template -m:n->Containter
This is how I originally imagined it:
41e8de122e904e0bb7c10e5a51a793fb.png
ContentList is added to the Template & Container bundle.
I found a statement on the Internet that Pivot-Tables cannot be used in the same way as models, hence the question "how?".
Of course, I can solve this without direct links between tables, but this will already be a crutch.
Thank you very much and have a great Friday evening everyone!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2017-06-10
@v_decadence

I didn’t really understand what you need, but there is a using method for the BelongsToMany relationship, which allows you to set a model for the Pivot table. I think that she can prescribe an additional relationship.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question