michaeldrennen/jsonapi

A framework agnostic PHP library that implements some of the json:api specification.
6,239 1
Install
composer require michaeldrennen/jsonapi
Latest Version:v2.0.2
PHP:^7|^8
License:MIT
Last Updated:Sep 14, 2026
Links: GitHub  ·  Packagist
Maintainer: michaeldrennen

JSONAPI

GitHub Build Status Codecov GitHub issues Packagist Beerpay

This is a PHP library for those wanting to build an API and return structured data to the requesting client.

// This $user is the object we want to return to the client requesting the User data.
$user  = new User( 74, "Mike", TRUE );

// Create the response object, set the $user as the data you want to return, and 
// specify the Transformer you want to use to munge the User data. 
$array = \MichaelDrennen\JSONAPI\Response::create()
                                         ->setData( $user )
                                         ->transformWith( new UserTransformer() )
                                         ->toArray();

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

391,429,217 4,660