Answer the question
In order to leave comments, you need to log in
How to use more than one method in controller?
public function search(Request $request){
$search_products = Product::where('title', 'LIKE', '%' . $request->get('search') . '%' )->get();
There is such a controller (for "live search"), you need to search not only in 'title', but also in 'description'.
This option doesn't work:
where('title', 'LIKE', '%' . $request->get('search') . '%' )||where('title', 'LIKE', '%' . $request->get('search') .'%' )->get()
since it returns a boolean value.
Answer the question
In order to leave comments, you need to log in
https://laravel.com/docs/7.x/queries#where-clauses clause orWhere
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question