All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning and this changelog format.
- Package now supports Laravel 11 and 12.
- Allow
laravel-json-api/core
v4 or v5.
- Remove deprecation notices in PHP 8.4.
- Package is now licensed under the MIT License.
- BREAKING Package now requires Laravel 11.
- Minimum PHP version is now
8.2
.
- #5 Fix error with default value for
$jsonApi
property on theDocument
class.
- Encoding implementation no longer catches and re-throws exceptions when encoding compound document. Although the implementation here was correct, we're getting far too many questions from developers who do not refer to the previous exception even though the exception message specified that there was a previous exception.
- Update exceptions thrown when the encoding process fails to notify developer to check previous exception for the cause of the failure.
- Upgraded to Laravel 10 and set minimum PHP version to
8.1
.
- Upgraded the
laravel-json-api/neomerx-json-api
dependency to^5.0.1
. This fixes a bug related to the top-level meta member. Previously the encoder added empty meta values to the top-level member, which is incorrect.
- Package now supports Laravel 9.
- Package now supports PHP 8.1.
- Upgraded the
laravel-json-api/neomerx-json-api
dependency to5.0
. - Upgraded the
laravel-json-api/core
dependency to2.0
. - Added return types to internal methods to remove deprecation messages in PHP 8.1
- Fixed setting the top-level
jsonapi
value on theDocument
class, which was not setting the cast value.
- The
RelationshipDocument
no longer merges relationship links with the top-level document links. This is because we now expect the top-level links provided to the encoder to already have the relationship links merged. Thecore
package takes care of this in the relationship response classes, while also providing the capability for the developer to turn off link merging if desired (which is a better implementation). This change is considered non-breaking because the core package dependency has been upgraded and there were existing bugs in the links merging implementation within theRelationshipDocument
class. I.e. it would fail if either of the self or related links were missing, or if the relationship was hidden - so removing this merging fixes bugs in the implementation.
Initial stable release, with no changes since 1.0.0-beta.1
.
- Updated the encoder to implement changes made to the encoder interface. This removes the
withIdentifiers()
method and replaces it with thewithToOne()
andwithToMany()
methods.
- When encoding relationships, do not yield a relationship value that is empty (no data, links or meta).
- This package now relies on
laravel-json-api/neomerx-json-api
, a fork ofneomerx/json-api
. This was required because of a bug affecting empty to-many include paths. Although a PR was sent to the Neomerx repository, there has been no activity in that repository for almost a year. The fork will be maintained for use in Laravel JSON:API, but we will switch back to using the Neomerx package if it is maintained in the future.
- Conditional field values are now correctly handled when iterating over a resource's relationships.
- Encoder now supports conditional fields being used in the JSON:API resource relationships.
- Fixed the schema's
getSelfLink()
method, which was not passing the request through to the JSON:API resource object.
- #2
New
withRequest
method on the encoder, allows a request to be passed into the encoding process. This is then provided to eachJsonApiResource
object when it is being encoded. This change was made to bring the resource into line with Laravel's Eloquent resource, which is passed the request when serializing models. (Changes to classes in theSchema
namespace to implement this are considered non-breaking, as they are internal classes.) - Resource meta can now contain conditional attributes, as the conditional iterator is used when processing meta
returned by the
JsonApiResource
class.
- #3
Add missing package discovery configuration to
composer.json
.
Initial release.