laravel-json-api/encoder-neomerx
Encode JSON:API resources using the neomerx/json-api package.
v4.3.0
1.6M downloads/mo
#2967 most downloaded on Packagist
laravel-json-api/encoder-neomerx
What this package is like to depend on
Last release 4 months ago
28 Mar 2026
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 12 of 12 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
17 releases · first in 2021
1 release in the last 12 months
see the full history below
Release timeline
17 releases · Jan 2021 to Mar 2026
2022
2023
2024
2025
2026
Releases
latest 17-
v4.3.028 Mar 2026Release notes
Open source →Added
- Support for Laravel 13.
Changed
- Dropped support for
laravel-json-api/corev4.
-
v4.2.024 Feb 2025 -
v4.1.030 Nov 2024Release notes
Open source →Added
- Allow
laravel-json-api/corev4 or v5.
Fixed
- Remove deprecation notices in PHP 8.4.
- Allow
-
v4.0.014 Mar 2024Release notes
Open source →Changed
- Package is now licensed under the MIT License.
- BREAKING Package now requires Laravel 11.
- Minimum PHP version is now
8.2.
-
v3.1.120 Nov 2023Release notes
Open source →Fixed
- #5 Fix error with default value for
$jsonApiproperty on theDocumentclass.
- #5 Fix error with default value for
-
v3.1.008 Nov 2023Release notes
Open source →Changed
- 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.
-
v3.0.118 Feb 2023Release notes
Open source →Changed
- Update exceptions thrown when the encoding process fails to notify developer to check previous exception for the cause of the failure.
-
v3.0.014 Feb 2023 -
v2.0.125 Jun 2022Release notes
Open source →Fixed
- Upgraded the
laravel-json-api/neomerx-json-apidependency 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.
- Upgraded the
-
v2.0.009 Feb 2022Release notes
Open source →Added
- Package now supports Laravel 9.
- Package now supports PHP 8.1.
Changed
- Upgraded the
laravel-json-api/neomerx-json-apidependency to5.0. - Upgraded the
laravel-json-api/coredependency to2.0. - Added return types to internal methods to remove deprecation messages in PHP 8.1
-
v1.1.003 Jan 2022Release notes
Open source →Fixed
- Fixed setting the top-level
jsonapivalue on theDocumentclass, which was not setting the cast value.
Removed
- The
RelationshipDocumentno 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. Thecorepackage 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 theRelationshipDocumentclass. 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.
- Fixed setting the top-level
-
v1.0.031 Jul 2021 -
v1.0.0-beta.130 Mar 2021 pre-releaseRelease notes
Open source →Changed
- Updated the encoder to implement changes made to the encoder interface. This removes the
withIdentifiers()method and replaces it with thewithToOne()andwithToMany()methods.
Fixed
- When encoding relationships, do not yield a relationship value that is empty (no data, links or meta).
- Updated the encoder to implement changes made to the encoder interface. This removes the
-
v1.0.0-alpha.427 Feb 2021 pre-releaseRelease notes
Open source →Changed
- 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.
Fixed
- Conditional field values are now correctly handled when iterating over a resource's relationships.
- This package now relies on
-
v1.0.0-alpha.309 Feb 2021 pre-releaseRelease notes
Open source →Added
- Encoder now supports conditional fields being used in the JSON:API resource relationships.
Fixed
- Fixed the schema's
getSelfLink()method, which was not passing the request through to the JSON:API resource object.
-
v1.0.0-alpha.202 Feb 2021 pre-releaseRelease notes
Open source →Added
- #2
New
withRequestmethod on the encoder, allows a request to be passed into the encoding process. This is then provided to eachJsonApiResourceobject 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 theSchemanamespace 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
JsonApiResourceclass.
Fixed
- #3
Add missing package discovery configuration to
composer.json.
- #2
New
-
v1.0.0-alpha.125 Jan 2021 pre-release