Download the PHP package coderscantina/laravel-filter without Composer
On this page you can find all versions of the php package coderscantina/laravel-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coderscantina/laravel-filter
More information about coderscantina/laravel-filter
Files in coderscantina/laravel-filter
Package laravel-filter
Short Description A filter object for Laravel/Eloquent models based on laracasts approach.
License MIT
Informations about the package laravel-filter
Filter Package from Coders' Cantina
A filter object for Laravel/Eloquent models based on laracasts approach.
Features
Getting started
- Install this package
Install
Require this package with composer:
Usage
Define a filter:
In your model:
In your controller:
Sortable
The Sortable
trait which is included in the ExtendedFilter
offers sorting abilities:
It is also possible to sort using a foreign key relation:
To limit the sortable columns, override the sortColumns
field:
Range Filter
The ExtendedFilter
offers helper for range filter, in the form:
And helpers for date range filtering:
Extending hints
- Override the method
getSortColumns
to have a custom implementation which columns are searchable. - Override the method
isValidMethod
to further limit the possible query params. Keep in mind to returnsort
in the array to allow sorting.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
All versions of laravel-filter with dependencies
illuminate/database Version ^8.0||^9.0||^10.0||^11.0
illuminate/http Version ^8.0||^9.0||^10.0||^11.0
illuminate/support Version ^8.0||^9.0||^10.0||^11.0