Download the PHP package alkhachatryan/laravel-enhanced-filters without Composer
On this page you can find all versions of the php package alkhachatryan/laravel-enhanced-filters. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alkhachatryan/laravel-enhanced-filters
More information about alkhachatryan/laravel-enhanced-filters
Files in alkhachatryan/laravel-enhanced-filters
Package laravel-enhanced-filters
Short Description Extensible Laravel filtering engine with Amazon-style faceted search. Supports field types (string, numeric, boolean, date), operator-level validation, clean structured errors, and automatic query builder mapping. Perfect for APIs, dashboards, and complex multi-field filters.
License
Informations about the package laravel-enhanced-filters
Laravel Enhanced Filters 🛠️
Enhanced Filters for Laravel provide a flexible, AWS-like filtering system for filtering. You can define fields, operators, and their validation rules, then use them to filter queries efficiently. ✅
It supports multiple field types, each with their own operators. The package handles validation, ensures only supported operators are used, and integrates seamlessly with Laravel request classes. 💡
Perfect for building advanced search and filter systems without writing repetitive query logic. 🚀
This is an API(backend, no UI) implementation only
Usage
Define Enhanced Filters in your Request Class
Your request class should implement HasEnhancedFilters and use EnhancedFilters trait:
Call the filter class in your controller/service/business logic class
Send your enhanced request
The example in postman below
Installation
That's it.
More about the package
So the package provides the extension for your request classes for filtering.
You will be able to filter like: FIELD - FILTERING_OPERATOR - VALUE
The package provides the following field-types:
- BooleanFieldType
- DateFieldType
- NumericFieldType
- StringFieldType
Each of them have their own specific filtering operators, but also have the common ones.
(not that true and false values(i.e. boolean) should be sent as a __true__ or __false__ strings
Common filtering operators for all field types
- equals - string/numberic value
- notEquals - string/numberic value
- isNull - __true__ or __false__
- isNotNull - __true__ or __false__
Boolean filtering operators
- isTrue - __true__ or __false__
- isFalse - __true__ or __false__
Date filtering operators
- before - a date formatted Y-m-d\TH:i:sP
- beforeOrEquals - a date formatted Y-m-d\TH:i:sP
- after - a date formatted Y-m-d\TH:i:sP
- afterOrEquals - a date formatted Y-m-d\TH:i:sP
- yearEquals - a date formatted Y
- notYearEquals - a date formatted Y
- monthEquals - a date formatted m
- notMonthEquals - a date formatted m
- dayEquals - an integer [1-31]
- notDayEquals - an integer [1-31]
- hourEquals - an integer [0-23]
- notHourEquals - an integer [0-23]
- minuteEquals - an integer [0-59]
- notMinuteEquals - an integer [0-59]
- secondEquals - an integer [0-59]
- notSecondEquals - an integer [0-59]
Numeric filtering operators
- greaterThan - numeric value
- greaterThanOrEquals - numeric value
- lessThan - numeric value
- lessThanOrEquals - numeric value
String filtering operators
- contains - string value
- notContains - string value
- startsWith - string value
- notStartsWith - string value
- endsWith - string value
- notEndsWith - string value
- lengthEquals - integer value
- lengthNotEquals - integer value
- lengthGreaterThan - integer value
- lengthLessThan - integer value
Versioning
The package has a semantic versioning X.Y.Z where X - a version of supported Laravel, Y a number of feature commits and a Z a number of bugfixes