Your IF condition is making that happen
$searchValue is equal to "sprint-10" therefore will never be equal to true
"sprint-10" == true // false
Maybe you want to do something like
if( $searchBy == 'product_id' && isset($searchValue) ) { $product = Product::where("product_id", 'like', "%$searchValue%")->paginate(5); return response($product); } else { return $requestQuery; }
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community