0👍
This should work:
$term = 10;
$query = Group::where('company_id', Auth::user()->company_id)->when($request->search, function($query,$term){
$query->where('code', 'LIKE' , '%' . $term. '%')
->orWhere('name', 'LIKE' , '%' . $term. '%')
->orWhere('description', 'LIKE' , '%' . $term. '%');
})->when($request->column, function($query, $term) use ($request){
$query->orderBy($term, $request->order);
});
if(request()->size != null) {
$term = (int)request()->size;
}
$query = $query->paginate($term);
- [Vuejs]-TypeError: Cannot read properties of null (reading 'shift')
- [Vuejs]-How can I run npm-watch in development mode?
Source:stackexchange.com