Answer the question
In order to leave comments, you need to log in
How to select posts for a specified city using Many to Many?
There are three tables
- posts
- cities
- post_city
How do I select posts only for the specified city? I did not find a solution in the documentation.
I tried to do it through the join () method when selecting posts (Post:: where ()-> join (), but then the data selection configured in the model, for example, in hasMany () stops working.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question