JSON API (jsonapi.org) support for Laravel applications.
- dev-develop / 3.x-dev
This package is auto-updated.
Last update: 2021-07-26 09:52:16 UTC
This package has now been rewritten, substantially improved and released as the
Documentation for the new version is available on our new website laraveljsonapi.io and the
code is now developed under the
Laravel JSON:API Github organisation.
cloudcreativity/laravel-json-api package is now considered to be the legacy package. As we know it is in use in
a lot of production applications, it will continue to receive bug fixes and updates for new Laravel versions. However,
it is no longer supported for new features.
If you are starting a new project, please use the
Build feature-rich and standards-compliant APIs in Laravel.
This package provides all the capabilities you need to add JSON API compliant APIs to your application. Extensive support for the specification, including:
- Fetching resources
- Fetching relationships
- Inclusion of related resources (compound documents)
- Sparse fieldsets.
- Creating resources.
- Updating resources.
- Updating relationships.
- Deleting resources.
- Validation of:
- JSON API documents; and
- Query parameters.
The following additional features are also supported:
- Full support for Eloquent resources, with features such as:
- Automatic eager loading when including related resources.
- Easy relationship end-points.
- Soft-deleting and restoring Eloquent resources.
- Page and cursor based pagination.
- Asynchronous processing.
- Support multiple media-types within your API.
- Generators for all the classes you need to add a resource to your API.
If you've ever argued with your team about the way your JSON responses should be formatted, JSON API is your anti-bikeshedding weapon.
By following shared conventions, you can increase productivity, take advantage of generalized tooling, and focus on what matters: your application. Clients built around JSON API are able to take advantage of its features around efficiently caching responses, sometimes eliminating network requests entirely.
For full information on the spec, plus examples, see http://jsonapi.org.
Want a tutorial to get started? Read the How to JSON:API Laravel tutorial.
Full package documentation is available on Read the Docs.
Join the Laravel JSON:API community on Slack.
Make sure you consult the Upgrade Guide when upgrading between major or pre-release versions.
Apache License (Version 2.0). Please see License File for more information.
Installation is via
composer. See the documentation for complete instructions.
Contributions are absolutely welcome. Ideally submit a pull request, even more ideally with unit tests. Please note the following:
- Bug Fixes - submit a pull request against the
- Enhancements / New Features - submit a pull request against the
We recommend submitting an issue before taking the time to put together a pull request.