I'm trying to create a relationship with the tables in my database using laravel, but with some difficulty in logic.
I have the tables; content
, client
and user
A user
can have several client
and a client
can have several user
, for this I created the ManyToMany
relationship. ( client_user
with the fields user_id
and client_id
), so far so good, I managed to make the relationship normally and now I can find out which clients belong to which user.
But I need to now select the contents
of client
that percents this user
, how would I do that?
I thought about creating a pivot table (also) for content
and client
but how would I make this selection?
I want to get the contents
that belongs to client
that percents user
...
See the database example