PHPackages                             laravel-json-api/laravel - 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. [API Development](/categories/api)
4. /
5. laravel-json-api/laravel

ActiveLibrary[API Development](/categories/api)

laravel-json-api/laravel
========================

JSON:API for Laravel applications.

v5.1.0(1y ago)6371.4M—0.3%45[80 issues](https://github.com/laravel-json-api/laravel/issues)[1 PRs](https://github.com/laravel-json-api/laravel/pulls)14MITPHPPHP ^8.2CI passing

Since Jan 25Pushed 1mo ago16 watchersCompare

[ Source](https://github.com/laravel-json-api/laravel)[ Packagist](https://packagist.org/packages/laravel-json-api/laravel)[ Docs](https://github.com/laravel-json-api/laravel)[ RSS](/packages/laravel-json-api-laravel/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (40)Used By (14)

[![Tests](https://github.com/laravel-json-api/laravel/workflows/Tests/badge.svg)](https://github.com/laravel-json-api/laravel/workflows/Tests/badge.svg)

JSON:API for Web Artisans
=========================

[](#jsonapi-for-web-artisans)

Implement feature-rich [JSON:API](https://jsonapi.org) compliant APIs in your [Laravel](https://laravel.com) applications. Build your next standards-compliant API today.

Why use JSON:API and Laravel JSON:API?
--------------------------------------

[](#why-use-jsonapi-and-laravel-jsonapi)

Great question! [Here's some reasons from this excellent article by Denisa Halmaghi](https://graffino.com/web-development/how-to-use-laravel-json-api-to-create-a-json-api-compliant-backend-in-laravel):

### Why Use JSON:API?

[](#why-use-jsonapi)

- Standardised, consistent APIs.
- Feature rich - some of which are: sparse fieldsets (only fetch the fields you need), filtering, sorting, pagination, eager loading for relationships (includes, which solve the *N+1* problem).
- Easy to understand.

### Why use Laravel JSON:API?

[](#why-use-laravel-jsonapi)

- Saves a lot of development time.
- Highly maintainable code.
- Great, extensive documentation.
- Strong conventions, but also highly customisable.
- Makes use of native Laravel features such as policies and form requests to make the shift easier for developers.
- Beautiful, expressive Nova-style schemas.
- Fully testable via expressive test helpers.

```
class PostSchema extends Schema
{

    /**
     * The model the schema corresponds to.
     *
     * @var string
     */
    public static string $model = Post::class;

    /**
     * The maximum include path depth.
     *
     * @var int
     */
    protected int $maxDepth = 3;

    /**
     * Get the resource fields.
     *
     * @return array
     */
    public function fields(): array
    {
        return [
            ID::make(),
            BelongsTo::make('author')->type('users')->readOnly(),
            HasMany::make('comments')->readOnly(),
            Str::make('content'),
            DateTime::make('createdAt')->sortable()->readOnly(),
            DateTime::make('publishedAt')->sortable(),
            Str::make('slug'),
            BelongsToMany::make('tags'),
            Str::make('title')->sortable(),
            DateTime::make('updatedAt')->sortable()->readOnly(),
        ];
    }

    /**
     * Get the resource filters.
     *
     * @return array
     */
    public function filters(): array
    {
        return [
            WhereIdIn::make($this),
            WhereIn::make('author', 'author_id'),
        ];
    }

    /**
     * Get the resource paginator.
     *
     * @return Paginator|null
     */
    public function pagination(): ?Paginator
    {
        return PagePagination::make();
    }
}
```

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

[](#documentation)

See our website, [laraveljsonapi.io](https://laraveljsonapi.io)

### Tutorial

[](#tutorial)

New to JSON:API and/or Laravel JSON:API? Then the [Laravel JSON:API tutorial](https://laraveljsonapi.io/4.x/tutorial/)is a great way to learn!

Follow the tutorial to build a blog application with a JSON:API compliant API.

Installation
------------

[](#installation)

Install using [Composer](https://getcomposer.org)

```
composer require laravel-json-api/laravel
```

See our documentation for further installation instructions.

Upgrading
---------

[](#upgrading)

When upgrading you typically want to upgrade this package and all our related packages. This is the recommended way:

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

Example Application
-------------------

[](#example-application)

To view an example Laravel application that uses this package, see the [Tutorial Application](https://github.com/laravel-json-api/tutorial-app).

License
-------

[](#license)

Laravel JSON:API is open-sourced software licensed under the [MIT License](./LICENSE).

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance67

Regular maintenance activity

Popularity62

Solid adoption and visibility

Community35

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 97.5% 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 ~42 days

Recently: every ~21 days

Total

36

Last Release

448d ago

Major Versions

v1.1.0 → v2.0.02022-02-09

v2.6.0 → v3.0.02023-02-14

v3.4.0 → v4.0.02024-03-14

v4.1.1 → v5.0.02024-12-01

PHP version history (4 changes)v1.0.0-alpha.1PHP ^7.4|^8.0

v1.0.1PHP ^7.4|8.0.\*

v3.0.0PHP ^8.1

v4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca1ed60931eb66b875b4bad2b1a8a5093c14d5225cf72c3d6c3fd403982ec7cf?d=identicon)[lindyhopchris](/maintainers/lindyhopchris)

---

Top Contributors

[![lindyhopchris](https://avatars.githubusercontent.com/u/4464333?v=4)](https://github.com/lindyhopchris "lindyhopchris (387 commits)")[![X-Coder264](https://avatars.githubusercontent.com/u/12602463?v=4)](https://github.com/X-Coder264 "X-Coder264 (2 commits)")[![helmroos](https://avatars.githubusercontent.com/u/40276856?v=4)](https://github.com/helmroos "helmroos (1 commits)")[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (1 commits)")[![aimeos](https://avatars.githubusercontent.com/u/8647429?v=4)](https://github.com/aimeos "aimeos (1 commits)")[![RobChatloop](https://avatars.githubusercontent.com/u/148765742?v=4)](https://github.com/RobChatloop "RobChatloop (1 commits)")[![SerhiiKotelnikov](https://avatars.githubusercontent.com/u/165281614?v=4)](https://github.com/SerhiiKotelnikov "SerhiiKotelnikov (1 commits)")[![villfa](https://avatars.githubusercontent.com/u/2891564?v=4)](https://github.com/villfa "villfa (1 commits)")[![PrinsFrank](https://avatars.githubusercontent.com/u/25006490?v=4)](https://github.com/PrinsFrank "PrinsFrank (1 commits)")[![dacercoolex](https://avatars.githubusercontent.com/u/32141484?v=4)](https://github.com/dacercoolex "dacercoolex (1 commits)")

---

Tags

laravellaraveljsonapiJSON-APIjsonapi.org

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravel-json-api-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-json-api-laravel/health.svg)](https://phpackages.com/packages/laravel-json-api-laravel)
```

###  Alternatives

[cloudcreativity/laravel-json-api

JSON API (jsonapi.org) support for Laravel applications.

7881.1M5](/packages/cloudcreativity-laravel-json-api)[timacdonald/json-api

A Lightweight JSON:API Resource for Laravel

639892.5k2](/packages/timacdonald-json-api)[neomerx/json-api

Framework agnostic JSON API (jsonapi.org) implementation

7373.6M27](/packages/neomerx-json-api)[laravel-json-api/eloquent

Serialize Eloquent models as JSON:API resources.

121.4M4](/packages/laravel-json-api-eloquent)[laravel-json-api/core

Contracts and support classes for Laravel JSON:API packages.

101.5M8](/packages/laravel-json-api-core)[cloudcreativity/json-api-testing

PHPUnit test helpers to check JSON API documents.

141.6M3](/packages/cloudcreativity-json-api-testing)

PHPackages © 2026

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