1 year ago

eloquent query doesn't working

Posted 1 year ago by uksarkar

I am writing a search pattern, my code is like this,

   $value = "something";
   $min = 10;
   $max= 100;
   $products = $product->where('name','like','%'.$value.'%')
                     ->orWhereHas('category',function($q) use($value){
                     ->whereHas('prices',function($q) use($max){
                     ->whereHas('prices', function($q) use($min){
                        $q->where('amounts','>=', $min);

but here the $min and $max value doesn't working. The result is coming without caring of min and max value.

Please sign in or create an account to participate in this conversation.