mdhesari/laravel-query-filters

Easily apply query filters in your controllers.

3.4.1 2023-09-24 09:17 UTC

README

Cool idea to apply query filters in your controllers.

Install

composer require mdhesari/laravel-query-filters

Usage

public function index(\Illuminate\Http\Request $request, \Mdhesari\LaravelQueryFilters\Actions\ApplyQueryFilters $applyQueryFilters) {
    return $applyQueryFilters(\MyModel::query(), $request->all())->paginate();
}

Actions

Query filters are a bunch of actions that you can use in order to filter your controllers.

Extend

We have provided some default filters in the default action that you can extend it with its abstract implementation.