All notable changes to laravel-query-builder will be documented in this file
- add support for Laravel 9
- drop support for older versions
- DOC: New sample with multiple default sorts by @williamxsp in spatie#694
- PHP 8.1 Support by @Medalink in spatie#702
- @williamxsp made their first contribution in spatie#694
- @Medalink made their first contribution in spatie#702
Full Changelog: https://github.com/spatie/laravel-query-builder/compare/4.0.1...4.0.2
- revert deferred service provider (#677)
- nested filters will no longer be automatically camel-cased to match a relationship name
- includes will no longer be automatically camel-cased to match a relationship name
- fields will no longer be automatically snake-cased to match table or column names
- switch to deferred service provider
Take a look at the upgrade guide for a more detailed explanation.
- add callback sorts (#654)
- add support for cursor pagination
- fix unexpected lowercase appends (#637)
- no changes
- fix simple paginator append not working (#633)
- add support for custom includes (#623)
- add support for getting request data from the request body (#589)
- fix issues when cloning
QueryBuilder(#621)
- prepend table name to
WHEREclause for ambiguous partial filters (#567) - add PHP 8 support
- prepend table name to
WHEREclause for ambiguous exact filters (#467)
- fix config key to disable
InvalidFilterQueryexception
- make nested scope compatible with older Laravel (#542)
- add ability to filter by nested relationship scopes (#519)
- add config key to disable
InvalidFilterQueryexception (#525)
- update what defines an ignored filter value (#533)
- add LengthAwarePaginator to QueryBuilder (#532)
- Revert changes from v3.2.1 to
AllowedFilter::filter()
- Fix filtering associative arrays (#488)
- AllowedFilter::filter() takes a
Illuminate\Database\Eloquent\Builderinstead of a QueryBuilder instance
- add support for Laravel 8
- add individual array delimiters for includes, filters, appends and sorts
- ensure relations queried using the exact filter are actual relations on the model
New major version. Please read the UPGRADING guide before upgrading.
Spatie\QueryBuilder\QueryBuilderclass no longer extends Laravel'sIlluminate\Database\Eloquent\Builder
- fix scope filters that are added via macros (e.g.
onlyTrashed) (#469)
- make service provider deferrable (#381)
- add support for Laravel 7
- small fix for lumen (#436)
- small fix for lumen in service provider
- add support for model binding in scope filter parameters (#415)
- fix alias for multiple allowed includes (#414)
- add
FiltersTrashedfor filtering soft-deleted models - add
FiltersCallbackfor filtering using a callback
- fix dealing with empty or
nullincludes (#395) - fix passing an associative array of scope filter values (#387)
- add
defaultDirection
- add support for a custom filter delimiter (#369)
- resolve
QueryBuilderRequestfrom service container
- fix issue when passing camel-cased includes (#336)
- add option to disable parsing relationship constraints when filtering related model properties in the exact and partial filters (#262)
- fix selecting fields from included relationships that are multiple levels deep (#317)
- add support for Laravel 6
- update doc block for
QueryBuilder::for() - add missing typehint in
SortsField
- removed request macros
- sorts and field selects are not allowed by default and need to be explicitly allowed
- requesting an include suffixed with
Countwill add the related models' count using$query->withCount() - custom sorts and filters now need to be passed as instances
- renamed
Spatie\QueryBuilder\SorttoSpatie\QueryBuilder\AllowedSort - renamed
Spatie\QueryBuilder\IncludedtoSpatie\QueryBuilder\AllowedInclude - renamed
Spatie\QueryBuilder\FiltertoSpatie\QueryBuilder\AllowedFilter Filter,IncludeandSortinterfaces no longer need to return theBuilderinstanceallowedFieldsshould be called beforeallowedIncludes- filters can now have default values
- includes will be converted to camelcase before being parsed
- bugfix: correctly parse sorts in
chunked query (#299) - bugfix: don't parse empty values in arrays for partial filters (#285)
- bugfix:
orderByRawis no longer being rejected as a sorting option (#258) - bugfix:
addSelectis no longer being replaced by the?fieldsparameter (#260) - bugfix: take leading dash into account when remembering generated sort columns (#272)
- bugfix:
allowedIncludesno longer adds duplicate includes for nested includes (#251)
- bugfix: remove duplicate parsing of (default) sort clauses
- bugfix: replace missing
sort()method onQueryBuilderRequest - bugfix: don't escape
allowedSorts and their aliases - bugfix: don't escape
allowedFields
- security fixes
- security fixes
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- moved features to traits
- started using
QueryBuilderRequestto read data from the current request - deprecated request macros (
Request::filters(),Request::includes(), etc...) - raised minimum supported Laravel version to 5.6.34
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add support for multiple default sorts (#214)
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add support for Laravel 5.5 and up (again)
- add support for PHP 7.1 and up (again)
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- fix default sort not parsing correctly (#178)
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- drop support for Laravel 5.7 and lower
- drop support for PHP 7.1 and lower
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add aliased sorts (#164)
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add support for Laravel 5.8
- use Str:: and Arr:: instead of helper methods
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- fix detection of false-positives for ignored values (#154)
- fix broken morphTo includes (#130)
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- allow ignoring specific filter values using
$filter->ignore() - allow filtering related model attributes
allowedFilters('related-model.name') - fix for filtering by relation model properties
- add custom sort classes
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- allow differently named columns
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- fix exception when using filters with nested arrays (#117)
- fix overwritten fields when using
allowedIncludeswith many-to-many relationships (#118)
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- fix exception when using
allowedFields()but selecting none
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add
allowedFieldsmethod - fix & cleanup
Request::fields()macro - fix fields option (
SELECT * FROM tableinstead ofSELECT table.* FROM table)
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- fix parsing empty filters from url
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- improve compatibility with Lumen
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add support for Laravel 5.7
- add framework/laravel as a dependency
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- improve compatibility with Lumen by only publishing the config file in console mode
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add support for instantiated custom filter classes
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- fix for using reserved SQL words as attributes in Postgres
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- make sure filtering on string with special characters just works
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- fix for using reserved SQL words as attributes
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- resolved #14
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- prevent double sorting statments
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- improvements around field selection
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add
Filter::scope()for querying scopes - explicitly defining parent includes in nested queries is no longer required
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add
allowedAppends()
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add ability to customize query parameter names
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add support for selecting specific columns using
?fields[table]=field_name
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- allow arrays in filters
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add support for Laravel 5.6
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- fix: initializing scopes, macro's, the onDelete callback and eager loads from base query on QueryBuilder
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- use specific exceptions for every invalid query
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- allow multiple sorts
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- allow
allowedIncludes,allowedFiltersandallowedSortsto accept arrays
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- remove auto registering facade from composer.json
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add support for global scopes and soft deletes
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- bugfix: revert #11 (escaping
_and%in LIKE queries)
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- escape
_and%in LIKE queries
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- add ability to set a default sort attribute
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- bugfix: using
allowedSortstogether with an empty sort query parameter no longer throws an exception
DO NOT USE: THIS VERSION ALLOWS SQL INJECTION ATTACKS
- initial release! 🎉