PHPackages                             sowl/laravel-doctrine-jsonapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sowl/laravel-doctrine-jsonapi

ActiveLibrary

sowl/laravel-doctrine-jsonapi
=============================

Package for the Laravel that allows developers to create JSON:API endpoints using the Doctrine ORM for data persistence.

12.0.2(11mo ago)0901↑757.1%1[2 PRs](https://github.com/ScholarshipOwl/laravel-doctrine-jsonapi/pulls)MITPHPPHP &gt;=8.2CI passing

Since Feb 27Pushed 9mo ago2 watchersCompare

[ Source](https://github.com/ScholarshipOwl/laravel-doctrine-jsonapi)[ Packagist](https://packagist.org/packages/sowl/laravel-doctrine-jsonapi)[ RSS](/packages/sowl-laravel-doctrine-jsonapi/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (9)Versions (23)Used By (0)

Laravel Doctrine JSON:API
=========================

[](#laravel-doctrine-jsonapi)

[![Build Status](https://camo.githubusercontent.com/4b961d388bd53173591eeedd7dec7f7a6281bab6664e176d20e5020ac95ede58/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f5363686f6c6172736869704f776c2f6c61726176656c2d646f637472696e652d6a736f6e6170692f63692e796d6c3f6272616e63683d6d61696e)](https://github.com/ScholarshipOwl/laravel-doctrine-jsonapi/actions)[![Code Coverage](https://camo.githubusercontent.com/32e1d7afd5b32c22effe3e7637880efe44714f4c63069190b93f65d7b8d975bf/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f5363686f6c6172736869704f776c2f6c61726176656c2d646f637472696e652d6a736f6e617069)](https://codecov.io/gh/ScholarshipOwl/laravel-doctrine-jsonapi)[![Latest Stable Version](https://camo.githubusercontent.com/e2cf41081be5d7dcbee3a0f8b8d4231d8256777304f0b489fb0ee73d1310405d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f776c2f6c61726176656c2d646f637472696e652d6a736f6e617069)](https://packagist.org/packages/sowl/laravel-doctrine-jsonapi)[![Total Downloads](https://camo.githubusercontent.com/66ded511151bbf9b2301780d4ce543ad47d62ba9c9016bbb981b159330ac9ad0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f776c2f6c61726176656c2d646f637472696e652d6a736f6e617069)](https://packagist.org/packages/sowl/laravel-doctrine-jsonapi)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Implement feature-rich [JSON:API](https://jsonapi.org/) compliant APIs in your [Laravel](https://laravel.com/) applications using [Doctrine ORM](https://www.doctrine-project.org/).

Overview
--------

[](#overview)

This package provides a comprehensive implementation of the JSON:API specification for Laravel applications using Doctrine ORM instead of Eloquent. It reduces boilerplate code by offering default controllers and actions that handle standard API operations while ensuring full compliance with the JSON:API standard.

Documentation
-------------

[](#documentation)

For detailed installation instructions, configuration guides and tutorials:

Features
--------

[](#features)

- **Complete JSON:API Implementation**: Full compliance with the JSON:API specification
- **Built for Doctrine ORM**: Designed specifically for Laravel applications using Doctrine ORM
- **Battle-tested**: Production-ready and robust
- **Standardised, Consistent APIs**: Uniform interface for all resources
- **Resource Operations**:
    - Fetch resources with advanced querying
    - Fetch and manipulate relationships
    - Inclusion of related resources (compound documents)
    - Sparse field sets
    - Sorting
    - Pagination
    - Filtering
- **Full CRUD Support**:
    - Create resources
    - Update resources
    - Update relationships
    - Delete resources
- **Authorization**: Policy-based access control
- **Auto-generated Documentation**: Endpoints are automatically documented using [Scribe](https://scribe.readthedocs.io/en/latest/)

### Bugs:

[](#bugs)

- In the `WithUpdateRelationshipsTrait` the we use `UpdateToManyRelationshipsRequest` for updating to-one relationships.
- Relationships with multipe resource type are not supported. Example is when we use inheritance type single table and we have different type for same table / relationship.

### Roadmap

[](#roadmap)

- Docs: Quickstart add how to install PHP section ( @see: php.new )
- Build documentation and testing for integration of Laravel Sanctum or Laravel Passport.
- Add Laravel Doctrine ACL package to testing
- Provide QueryBuilder for the filter parsers, instead of criteria as it allows to apply any types of filters.
- Remove the default request hydration from the package, as it may create security vulnerabilities. All the mutations should be handled by the application code, by the client.
- Improve security by adding ability checks on the transformer level when we try to include relationships.
- Scribe: Generated headers are not prperly defined, we got Accept: */* everywhere.
- Allow override or provide ability for custom request authentication.
- Integrate scribe into the package. Automatically generate Open API specs.
    - Add documentation for scribe integration
    - Update metadata for each endpoint
        - Endpoint description
        - Endpoint tags
        - Endpoint name
        - Endpoint group
    - Route\\URL params documentation
    - Query params documentation
        - Add a fields lists to each query documentation. Need to extract it from the transformer.
        - Filter query parameters documentation
    - Request body documentation
        - Analyze scribe default rules parser find ways to improve it.
    - Response body documentation
        - Create ValidationResponseAttribute that goint to read rules from validation and generate example response.
- Add documentation about the `meta` param usage. ( meta\[account\]=mailbox&amp;meta\[profile\]=completeness )
- Make it possible to disable links generation. As it is not required by JSON:API spec and increases response size.
- Add generics to all the types using ResourceInterface
- Move default routes to the separate file and load them on boot. ( see how Scribe doing it )
- 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.
- Checkout option for adding include params like "include=roles:sort" (TransformerAbstract.php:173)
- Integrate UUID support by default

#### Next version

[](#next-version)

- Use PHP Attributes instead of `ResourceInterface` for the resource declaration.
- Metadata managment system similar to Doctrine one, that knows the resource schemas and relationships, etc. On boot register all the resources and cache them.
    - Resource type, transformers, relationships discovery, moved to the metadata system / `ResourceManager`.
    - Generate the resourceType depend on the entity name
    - Generate the transformers depend on the entity name and configuration path: `app/Transformers/{Entity}Transformer.php`
    - Allow defining relationships with PHP Attributes on the entity class.
    - The id get be retrieved using internal Doctrine functionality or just depend on public $id property.
- Migrate all the default users and roles to be UUID
- Improve transformer, make it handle relationships depend on resource. Use better name like "ResourceTransformer".

Support
-------

[](#support)

If you encounter any issues or have questions, please report them using the [GitHub Issues](https://github.com/ScholarshipOwl/laravel-doctrine-jsonapi/issues) tracker.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance55

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Recently: every ~0 days

Total

14

Last Release

335d ago

Major Versions

9.0 → 10.02023-11-13

10.1.0 → 11.x-dev2025-04-20

11.0.0 → 12.0.02025-04-20

PHP version history (2 changes)10.0PHP ^8.1

11.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d3fa6af699b70f877d632ed3dc64cb86da1d6fed4cb5b42d7c09b234fdc7b16?d=identicon)[R3VoLuT1OneR](/maintainers/R3VoLuT1OneR)

---

Top Contributors

[![R3VoLuT1OneR](https://avatars.githubusercontent.com/u/1111188?v=4)](https://github.com/R3VoLuT1OneR "R3VoLuT1OneR (139 commits)")[![jrean](https://avatars.githubusercontent.com/u/5646128?v=4)](https://github.com/jrean "jrean (7 commits)")

---

Tags

doctrinedoctrine-ormjson-apilaravelphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sowl-laravel-doctrine-jsonapi/health.svg)

```
[![Health](https://phpackages.com/badges/sowl-laravel-doctrine-jsonapi/health.svg)](https://phpackages.com/packages/sowl-laravel-doctrine-jsonapi)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
