lacodix/laravel-model-filter
Filter, search, and sort Eloquent models with reusable filter classes and query-string support. Includes built-in types (string, date, number, enum), relation/nested relation filtering, custom complex logic, and filter visualisation.
You can install the package via composer:
composer require lacodix/laravel-model-filter
The package brings a config file and views with translations, that can be published.
php artisan vendor:publish --tag="model-filter-config"
This is the content of the published config file:
return [
'date_format' => 'Y-m-d',
'search_query_value_name' => 'search',
'search_query_fields_name' => 'search_for',
];
You can publish the view components with:
php artisan vendor:publish --tag="lacodix-filter-views"
You can publish the translation files with:
php artisan vendor:publish --tag="model-filter-translations"
Translations are only needed, if you use one of the extended filters like the TrashedFilter.
How can I help you explore Laravel packages today?