Answer the question
In order to leave comments, you need to log in
Order by retaliation field, laravel?
There is a product table, there is a city table.
There is a city_product. In each city, the price of goods may be different. I need to get a list of goods, and a list of cities in which it is. The default is to sort by product name, so I do $products = Product:with('cities').
But if the filter by city is selected, then you need to filter by price. How to do it better?
join ? But it's still a halo for me to use with to get the model of the city. Then do both with() and join ?
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