mgsmus
Abi sürekli bu hatayı verdi durdu laravel eski sürümü kullandığım için oluyor sanırım.
"Call to a member function getBindings() on string"
Bende bu şekilde çözdüm
$products = Product::whereStatus(1)
->where('show', 1)
->where('code', '!=', 1);
$query = $request->input('query', '');
$blogs = Blog::where('published', 1)->select('id', 'title as name','slug')
->where(function ($q) use ($query) {
return $q->orWhereRaw("MATCH(title) AGAINST (? IN BOOLEAN MODE)", [$query]);
});
$products = $products->where(function ($q) use ($query) {
return $q->orWhereRaw("MATCH(name) AGAINST (? IN BOOLEAN MODE)", [$query])
->orWhere('id', 'LIKE', "%$query%")
->orWhere('unique_id', 'LIKE', "%$query%");
});
$products->when($request->filled('type') && !in_array('all', $request->input('type')), function () use ($request,$products) {
$products->whereIn('product_type', $request->input('type'));
});
$data['products'] = $products->get();
$mergedResults['products'] = $data['products']->merge($blogs->get());
return response()->json($mergedResults);