Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Laravel Package

laravel-json-api/laravel

View on GitHub
Deep Wiki
Context7
v5.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v5.2.1...v5.3.0

v5.2.1

What's Changed

New Contributors

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v5.2.0...v5.2.1

v5.0.2

Upgrading

composer up laravel-json-api/laravel

What's Changed

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v5.0.1...v5.0.2

v5.0.1

Upgrading

composer up laravel-json-api/laravel

What's Changed

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v5.0.0...v5.0.1

v5.0.0

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-testing

Although this is a major release with a breaking change (see below), the vast majority of applications should be able to upgrade without making any changes. You will only need to make a change if you're directly calling the authorizeResource() method on a JSON:API HTTP request class.

What's Changed

  • feat: support Illuminate\Auth\Access\Response from authorizer by @haddowg in https://github.com/laravel-json-api/laravel/pull/298
  • #70 The authorizer implementation now allows methods to return either bool or an Illuminate Auth Response.
  • BREAKING The return type for the authorizeResource() method on both resource and query request classes has changed to bool|Response (where response is the Illuminate Auth response). If you are manually calling this method and relying on the return value being a boolean, this change is breaking. However, the vast majority of applications should be able to upgrade without any changes.

New Contributors

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v4.1.1...v5.0.0

v4.1.1

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-testing"

What's Changed

New Contributors

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v4.1.0...v4.1.1

v4.1.0

Upgrading

composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"

Changelog

Fixed

  • core#17 Fix incorrect self link in related resource responses, and remove related link that should not exist. This has been incorrect for some time, but is definitely what the spec defines here.
  • eloquent#36 Support Eloquent dynamic relationships.

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v4.0.0...v4.1.0

v4.0.0

Upgrading

composer require laravel-json-api/laravel:^4.0 --no-update
composer require laravel-json-api/testing:^3.0 --dev --no-update
composer up "cloudcreativity/*" "laravel-json-api/*"

What's Changed

Changelog

Changed

  • Package is now licensed under the MIT License.
  • BREAKING Package now requires Laravel 11.
  • Minimum PHP version is now 8.2.

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v3.4.0...v4.0.0

v3.4.0

Upgrading

composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"

What's Changed

New Contributors

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v3.3.0...v3.4.0

v3.3.0

Upgrading

composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"

What's Changed

Full Changelog: https://github.com/laravel-json-api/laravel/compare/v3.2.0...v3.3.0

v3.2.0

Upgrading

composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"

Changelog

Added

  • Exceptions converted to JSON:API errors when debug mode is on now include all previous exceptions.

Changed

  • Registering routes no longer results in the server instance being thread-cached. This more accurately reflects production environments, where routes would be cached so there would be no thread-cached JSON:API server when handling a HTTP request. This means tests (and development environments where routes are not cached) more accurately behave in the same way as production environments.
  • Exceptions thrown during the encoding process are no longer caught and re-thrown as previous exceptions. This is due to the number of questions we receive from developers who do not check previous exceptions, despite exception messages stating that there is a previous exception to look at.
v3.1.0

Upgrading

composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"

Changelog

Added

  • core#12 Add ulid() method to the ID field class.
v3.0.0

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-testing

Changelog

Changed

  • Upgraded to Laravel 10 and set minimum PHP version to 8.1.
  • BREAKING If using the laravel-json-api/cursor-pagination package, you now need to passed the schema's id field to the paginator's make() method. I.e. use CursorPagination::make($this->id())

Fixed

  • BREAKING #190 The JSON:API media type now needs to be sent in the Accept header for a "delete" resource request. Previously there was no checking of the Accept media type, so anything could be sent. This is incorrect as the JSON:API specification shows the Accept header as application/vnd.api+json for delete resource requests.
v2.6.0

Upgrading

composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"

Changelog

Added

  • New MultiPaginator that 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:
    • fields
    • page
    • filter
v2.5.2

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 fields query parameter, e.g. /api/v1/employees?fields[employees]=.
v2.5.1

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.
v2.5.0

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 WhereNull and WhereNotNull filters.

Fixed

  • #204 Fix exception parser causing error when request does not have a matching route (e.g. in a 404 Not Found scenario).
  • Fixed PHP 8.2 deprecation messages in the laravel-json-api/validation dependency.
v2.4.0

Upgrading

composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"

Changelog

Added

  • The JsonApiException class now has a context() 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 Acceptable and 415 Unsupported Media Type messages to the following two new exception classes:
    • Exceptions\HttpNotAcceptableException
    • Exceptions\HttpUnsupportedMediaTypeException

Fixed

  • #184 Ensure that an Accept header with the media type application/json is rejected with a 406 Not Acceptable response. Previously this media type worked, which is incorrect as the JSON:API specification requires the media type application/vnd.api+json.
  • #197 Fix sending null for a to-one relationship update.
v2.3.0

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.
v2.2.0

Upgrading

composer require laravel-json-api/laravel

Changelog

Added

  • #181 The JsonApiController now extends the base Laravel controller.

Fixed

  • #180 Add missing method to the Authorizer stub.
v2.1.2

Upgrading

composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*"

Changelog

Fixed

  • #175 Fix page URLs missing sparse field sets.
v2.1.1

Upgrading

composer require laravel-json-api/laravel --no-update
composer up laravel-json-api/*

Changelog

Fixed

  • #178 Allow a resource id that is "0".
v2.1.0

Upgrading

composer require laravel-json-api/laravel --no-update
composer up laravel-json-api/*

Changelog

Added

  • #110 For requests that modify a relationship, it is now possible to get the model or models referenced in the request JSON using the toOne() or toMany() methods on the resource request class.
  • #113 The Eloquent Number field can now be configured to accept numeric strings by calling the acceptStrings() method on the field.
v2.0.0

Upgrading

Refer to the upgrade guide on our website.

Changelog

Added

  • This package now supports Laravel 9.
  • This package now supports PHP 8.1.

Changed

  • BREAKING PHP 8.1 introduces readonly as a keyword. It was therefore necessary to rename the following interface and trait:
    • LaravelJsonApi\Eloquent\Contracts\ReadOnly is now IsReadOnly.
    • LaravelJsonApi\Eloquent\Fields\Concerns\ReadOnly is now IsReadOnly.
  • Return types have been added to all internal methods in all child packages, to remove deprecation messages in PHP 8.1
  • #83 Amended container bindings to ensure package works with Laravel Octane. Most of these changes should have no impact on consuming applications. However, the following changes could potentially be breaking to the JSON:API Server class in an application:
    • The type-hint of the first constructor argument has changed to LaravelJsonApi\Core\Support\AppResolver.
    • The deprecated $container property has been removed, and the $app property is now private. To access the current application instance in your server class, use $this->app() instead.
  • BREAKING #110 The model() and modelOrFail() methods on the ResourceQuery request class have been changed from public to protected. These were not documented for use on this query class, and were only intended to be used publicly on the ResourceRequest class. Although technically breaking, this change is unlikely to affect the vast majority of applications which should not be using the method.
v1.1.0

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.
v1.0.1

Upgrading

composer up laravel-json-api/*

Changed

  • The maximum PHP version is now 8.0. PHP 8.1 is not supported because it introduces a breaking change. The next major version of this package will add support for PHP 8.1.

Fixed

  • #139 Fix the WhereHas and WhereDoesntHave filters. Previously these were not iterating over the filters from the correct resource schema - they were iterating over the filters from the schema to which the relationship belonged. They now correctly iterate over the filters from the schema for the resource that is on the inverse side of the relationship.
v1.0.0

Finally, our initial stable release. Yes there's more features to work on, but this package is definitely production ready - so here at last is a stable release!

Upgrade Instructions

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-testing

Added

  • New relationship filter classes: Has, WhereHas, WhereDoesntHave. Refer to the filter documentation for details.

Changed

  • BREAKING: Countable Relationships. This feature is now turned off by default. Although included in the 1.0 release, this feature is not considered production-ready. This is because we plan to make breaking changes to it, which will change how the client requests countable relationships. As such, this feature is considered highly-experimental and developers must opt-in to it by calling the canCount() method on a relationship. Refer to the Countable relationships chapter in the documentation for more details.
  • BREAKING: Cursor Pagination. Laravel now has its own cursor pagination feature. We have therefore moved our implementation into its own package: laravel-json-api/cursor-pagination This change has been made because it makes sense for the in-built cursor pagination implementation to use Laravel's cursor pagination implementation rather than our own custom one. Support for Laravel's cursor pagination will be added during the 1.x release cycle. If you are already using our cursor implementation, you can migrate in two easy steps:
    1. Install the new package: composer require laravel-json-api/cursor-pagination
    2. In any schemas using the cursor pagination, change the import statement from LaravelJsonApi\Eloquent\Pagination\CursorPagination to LaravelJsonApi\CursorPagination\CursorPagination.
v1.0.0-beta.5

Added

  • The authorizer now has separate showRelated() and showRelationship() methods. Previously both these controller actions were authorized via the single showRelationship() method. Adding the new showRelated method means developers can now implement separate authorization logic for these two actions if desired. Our default implementation remains unchanged - both are authorized using the view<RelationshipName> method on the relevant policy.
  • The request class now has a isCreatingOrUpdating() helper method to determine whether the request is to create or updated a resource.
  • Add stop on first failure to all validators in the resource request class.
  • #85 When running an application with debug mode turned on, the default JSON:API error object for an exception will now contain detailed exception information, including the stack trace, in the object's meta member.
  • #103 Can now fully customise attribute serialization to JSON using the extractUsing() callback. This receives the model, column name and value. This is useful if the developer needs to control the serialization of a few fields on their schema. However, the recommendation is to use a resource class for complete control over the serialization of a model to a JSON:API resource.

Changed

  • Minimum Laravel version is now 8.30. This change was required to use the $stopOnFirstFailure property on Laravel's FormRequest class.
  • Schema classes no longer automatically sort their fields by name when iterating over them. This change was made to give the developer full control over the order of fields (particularly as this order affects the order in which fields are listed when serialized to a JSON:API resource). Developers can list fields in name order if that is the preferred order.
  • Removed the LaravelJsonApi\Spec\UnexpectedDocumentException which was thrown if there was a failure when decoding request JSON content before parsing it for compliance with the JSON:API specification. A JsonApiException will now be thrown instead.

Fixed

  • #101 Ensure controller create action always returns a response that will result in a 201 Created response.
  • #102 The attach and detach to-many relationship controller actions now correctly resolve the collection query class using the relation's inverse resource type. Previously they were incorrectly using the primary resource type to resolve the query class.
v1.0.0-beta.4

Fixed

  • #76 Pagination links will now be correctly added to related resources and relationship identifiers responses.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle