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

ActiveLibrary[API Development](/categories/api)

delkano/f3-jsonapi
==================

A few helpful classes for quick implementation of a JsonAPI server with the FatFreeFramework

911PHP

Since Sep 22Pushed 4y ago3 watchersCompare

[ Source](https://github.com/delkano/f3-jsonapi)[ Packagist](https://packagist.org/packages/delkano/f3-jsonapi)[ RSS](/packages/delkano-f3-jsonapi/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

F3-JsonAPI
==========

[](#f3-jsonapi)

Introduction
------------

[](#introduction)

I've had to write a few JsonAPI servers and, at some point, I've started to distil all the common code into a separate class. This is still a work in progress and will be for a while, since it is both my first library and a rewrite of those common classes I was talking about; but it should be operative.

Use
---

[](#use)

### Dependencies

[](#dependencies)

f3-jsonapi is a [FatFreeFramework](https://fatfreeframework.com/) plugin. These instructions assume you are working in a FatFreeFramework project.

In addition, you need to have [F3-Cortex](https://github.com/ikkez/f3-cortex) installed and configured.

### Installation

[](#installation)

You can install f3-jsonapi in your project with:

```
composer require delkano/f3-jsonapi

```

### Configuration

[](#configuration)

Then list all your models into your config.ini

```
[models]
=

```

Define each model in the namespace `Model`, using F3-Cortex for this, and finally call the setup method in your index.php before `$f3->run()`:

```
JsonApi::setup();

```

I have added to the F3-Cortex model definition one attribute for the 'has-many' relationships. If you add

```
'async' => true,

```

the relationship won't be detailed inline. This is useful for very large relationships.

You don't need to define any controllers, since each model is assigned the `readable` controller by default. However, if you want to customize the behaviour, you can extend any of the provided base controllers (`JsonApi`, `Readable` and `Restricted`) and override their methods.

For ease of editing, there are some hooks provided:

```
processInput
postSave
processSingleQuery
processListQuery
orderRelationship

```

I will write some documentation for them, but for now you can check the JsonApi controller code to see their working.

Current status
--------------

[](#current-status)

- Base controller works
- Readable controller, for those objects that can only be edited by their creators but publicly read
- Restricted controller, for those objects that can only be accessed by their creators
- The fallback controller, which is assigned to any models without an explicit controller, defaults to Readable
- Setup is written
- Needs testing

Although F3-JsonAPI is to be considered under development, I have been using it for my own projects for some time and it is stable and working.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/293b1a41e78365340493ad91427f4899e1e0cc9315c7de46e369ae778402cfd8?d=identicon)[delkano](/maintainers/delkano)

---

Top Contributors

[![delkano](https://avatars.githubusercontent.com/u/6650309?v=4)](https://github.com/delkano "delkano (36 commits)")

---

Tags

f3f3-jsonapijsonapi-serverphp

### Embed Badge

![Health badge](/badges/delkano-f3-jsonapi/health.svg)

```
[![Health](https://phpackages.com/badges/delkano-f3-jsonapi/health.svg)](https://phpackages.com/packages/delkano-f3-jsonapi)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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