sowl / laravel-doctrine-jsonapi
Package for the Laravel that allows developers to create JSON:API endpoints using the Doctrine ORM for data persistence.
10.0.1
2024-01-07 19:31 UTC
Requires
- php: ^8.1
- doctrine/orm: ^2.14
- laravel/framework: ^10.0
- league/fractal: ^0.20.1
- ramsey/uuid: ^4.7
Requires (Dev)
- doctrine/annotations: ^2
- fzaninotto/faker: ^1.5
- gedmo/doctrine-extensions: ^3.11
- laravel-doctrine/acl: ^1.7
- laravel-doctrine/extensions: ^1.6
- laravel-doctrine/migrations: ^3.1
- laravel-doctrine/orm: ^2.0
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-04-16 20:30:28 UTC
README
Implement feature-rich JSON:API compliant APIs in your Laravel applications using Doctrine ORM.
Features
- Built for Doctrine ORM
- Battle-tested
- Standardised, consistent APIs
- Fetch resources
- Fetch relationships
- Inclusion of related resources (compound documents)
- Sparse field sets
- Sorting
- Pagination
- Filtering
- Create resources
- Update resources
- Update relationships
- Delete resources
Documentation
Installation instructions, config guides and tutorials.
Development
Clone the project locally.
Install the package dependencies and run the tests:
docker compose run php
To enter the docker container:
docker compose run php sh
Testing
Roadmap
- Make it possible to disable links generation. As it is not required by JSON:API spec and increases response size.
- Create a validation rule "resource", "resourceExists" for validating resource identifier. Example of usage:
php $this->validate($request, [ 'data' => 'required|resource:users', ]);
- Create default global error handler or write down documentation how to create such one. How to handle missing route\endpoint 404 and internal 500 errors.
- Create console command for resource policy generation: "jsonapi:make:policy".
- Checkout option for adding include params like "include=roles:sort" (TransformerAbstract.php:173)