I have a query stored in a variable.
how to apply this variable to whereHas closure?
$productQuery = ...; // complex query comes from another class
return CategoryModel::whereHas('products', function ($query) use($productQuery) {
$query->apply($productQuery) // I need to apply product query here but Laravel has not this method
})->get();
from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2YfUNqz
via IFTTT
Aucun commentaire:
Enregistrer un commentaire