Releases: laravel-json-api/laravel
Releases · laravel-json-api/laravel
ULID helper method on ID field
Upgrading
composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"Changelog
Added
- core#12 Add
ulid()method to theIDfield class.
Laravel 10 on Valentine's Day
Upgrading
composer require laravel-json-api/laravel --no-update
composer require laravel-json-api/testing --dev --no-update
composer up "laravel-json-api/*" cloudcreativity/json-api-testingChangelog
Changed
- Upgraded to Laravel 10 and set minimum PHP version to
8.1. - BREAKING If using the
laravel-json-api/cursor-paginationpackage, you now need to passed the schema'sidfield to the paginator'smake()method. I.e. useCursorPagination::make($this->id())
Fixed
- BREAKING #190 The JSON:API media type now needs to be sent in the
Acceptheader for a "delete" resource request. Previously there was no checking of theAcceptmedia type, so anything could be sent. This is incorrect as the JSON:API specification shows theAcceptheader asapplication/vnd.api+jsonfor delete resource requests.
Add multi-paginator plus validation bugfix
Upgrading
composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"Changelog
Added
- New
MultiPaginatorthat allows a schema to offer multiple different pagination strategies.
Fixed
- The JSON:API rule validators for the follow query parameter fields all errored if a non-array value was provided. This is now fixed:
fieldspagefilter
Fix fields query parameter validation
Upgrading
composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"Changelog
Fixed
- #225 Fix validation of empty field list for a resource type in the
fieldsquery parameter, e.g./api/v1/employees?fields[employees]=.
Fix stale state on Eloquent models after write operation
Upgrading
composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"
Changelog
Fixed
- #223 Ensure Eloquent models always have fresh data after write operation. This is to prevent cached relationships from having "stale" data after the write operation. This can occur if a related model's attributes change during the write operation, but the related model was cached before the write operation occurred.
Conditional eager loading and where null filters
Upgrading
composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"Changelog
Added
- Relations can now be conditionally set to be eager-loadable via the
canEagerLoad()method. - New
WhereNullandWhereNotNullfilters.
Fixed
- #204 Fix exception parser causing error when request does not have a matching route (e.g. in a
404 Not Foundscenario). - Fixed PHP 8.2 deprecation messages in the
laravel-json-api/validationdependency.
Exception improvements and bug fixes
Upgrading
composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"Changelog
Added
- The
JsonApiExceptionclass now has acontext()method. Laravel's exception handler uses this to add log context when the exception is logged. This means logging of JSON:API exceptions will now include the HTTP status code and the JSON:API errors. - Moved the default
406 Not Acceptableand415 Unsupported Media Typemessages to the following two new exception classes:Exceptions\HttpNotAcceptableExceptionExceptions\HttpUnsupportedMediaTypeException
Fixed
- #184 Ensure that an
Acceptheader with the media typeapplication/jsonis rejected with a406 Not Acceptableresponse. Previously this media type worked, which is incorrect as the JSON:API specification requires the media typeapplication/vnd.api+json. - #197 Fix sending
nullfor a to-one relationship update.
Spanish and Brazilian Portuguese translations
Upgrading
composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"Changelog
Added
- Added Spanish and Brazilian Portuguese translations for specification and validation error messages.
Controller improvement and fix broken stub
Fix sparse field sets in page URLs
Upgrading
composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"Changelog
Fixed
- #175 Fix page URLs missing sparse field sets.