when(request()->has('keyword'), function ($query) { $query->where('term', 'LIKE', request('keyword') . '%'); }); } }