Symfony version(s) affected: ~4.0
Description I am using laravel(5.6.*) and write simple eloquent query as follows.
$query = "something";
$products = Product::
where('title', $query)
->paginate($limit);
But i get "Object of class Symfony\Component\HttpFoundation\ParameterBag could not be converted to string"
Yesterday it is working perfectly fine and today i don't know what happened. Please help me with this. I am providing simple search functionality using that query.
Please check screen shot for more information.
Update
Please look at new code but still no luck in that.
function get(Request $request) {
$limit = 10;
$query = "";
if ($request->has('limit')) {
$limit = $request->limit;
}
if ($request->has('query')) {
$query = $request->query;
}
$products = Product::
where('title','like', '%'.$query.'%')
->orWhere('variant_title', 'like', '%'.$query.'%')
->orWhere('variant_sku', 'like', '%'.$query.'%')
->orWhere('tags', 'like', '%'.$query.'%')
->paginate($limit);
$products = $products->withPath('/products');
return $products;
}