I have a function that gets a list of maps from the database. It is necessary to improve it so that when passing through $ request fields for search (series, number, balance) a corresponding query is built (there may be more fields, a large number of if else is not an option).
public function card_list(Request $request) { $q = $request->input('card') ; $this->data['cards'] = Card::where('id', '>', 0)->paginate(15); return view('pages.card_list', $this->data); }