A PHP package for mapping remote {json:api} resources to Eloquent like models and collections.
The first stable release! 🎉 This release includes some bugfixes and changes in order to align with the specification.
ValidationException
messages to align them with the wordings used in the specification.DocumentParser
throws a ValidationException
when it encounters duplicate resources #64.TypeMapperInterface
and TypeMapper
are now registered as the same singleton #65.ItemHydrator
unsets a relation when null (singular) or empty array (plural) instead of hydrating a relation with id null
#67.This release includes a small breaking change because we switched from PHP-HTTP to PSR-18, its successor. Almost all PHP-HTTP clients now implement PSR-18, so this should not be a big problem. This also means for example that PSR exceptions are thrown instead of PHP-HTTP exceptions. If you are relying on some PHP-HTTP classes yourself, make sure to review your code and change those to their PSR equivalent. If you are using this package within a Laravel application, it is important to note that we also changed the way how you can bind your own HTTP client. Please see the documentation and compare all code changes for more details!
\Swis\JsonApi\Client\Client
now uses php-http/discovery itself instead of the service provider. This should make usage without Laravel easier #60.$baseUri
parameter from \Swis\JsonApi\Client\Client::__construct()
, use \Swis\JsonApi\Client\Client::setBaseUri()
instead #60.\Swis\JsonApi\Client\Providers\ServiceProvider::getHttpClient()
and \Swis\JsonApi\Client\Providers\ServiceProvider::getMessageFactory()
as the client now discovers these classes itself. Custom HTTP clients must now be registered within your own service provider using a custom container binding #60.null
#59.