DEV Community

loading...

Discussion on: Making the advanced query filter with Eloquent Filter in Laravel

Collapse
mehdifathi profile image
Mehdi Fathi Author • Edited

Thanks, you can use this code

$perpage = Request::input('perpage');
Request::offsetUnset('perpage');
$users = User::filter($modelFilters)->with('posts')->orderByDesc('id')->paginate($perpage,['*'],'page');

You can make every param for your self but you can unset before send to filter method model