Upgrading
composer require laravel-json-api/laravel --no-update
composer up laravel-json-api/*
Added
- The default JSON:API resource class can now be changed via the
LaravelJsonApi\Laravel\LaravelJsonApi::defaultResource()
method. This should be set in a service provider's register()
method.
- #127 The
JsonApiResource
class now has a protected serializeRelation
method that can be used to override the default serialization of relationships if needed.
- #111 Relationship documents returned by relationship
self
routes will now include any non-standard links set on the resource relationship in the top-level links
member.
Fixed
- #147 Related relationship response now correctly merge the relationship links into the top-level document links member.
- #130 The
JsonApiResource
now correctly handles conditional fields when iterating over relationships to find a specific relation.
- #105 The JSON:API document returned by a relationship
self
route now handles a relationship not existing if it is hidden. Previously an exception was thrown when attempting to merge relationship links into the document.
- #111 Relationship documents now handle a relationship that does not have one or both of the
self
and related
relationship links.