Verify yourself to prove that you are not a ROBOT! After verification the page will apear. Thanks for understanding.
|Added at||2018-01-03 21:01|
I've been looking at the newQuery eloquent model and best case uses and I can see the benefit in searching / filtering products based on a search page however is it possible to call the newQuery on only the Users related products?
For example, I have 2 models.
User has many products and I have the relationship defined on the user model.
Now, previously if I wanted to filter all the products and take user out of the scenario I could use:
This is great and I like this method and I now want to have a similar functionality on only users products.
For example, id like to:
But I can't do this I get newQuery() method is not available.
Is there a better way of performing optional queries based on parameters?