# Fractal

> Presentation and transformation layer for JSON API output in PHP

Source: https://talira.ai/catalog/fractal-1x7dnxbq
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / serialization](https://talira.ai/categories/libraries/serialization), [languages / php](https://talira.ai/categories/languages/php)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [The League of Extraordinary Packages](https://talira.ai/orgs/thephpleague.md)

Fractal is a PHP library from The League of Extraordinary Packages that sits between your data and your API's output, a view layer for JSON and similar formats. Transformers shield users from schema changes and cast types systematically; it includes (embeds or side-loads) related resources, paginates results, and serialises to HAL, JSON:API or a format of your own.

## Links

- Website: https://fractal.thephpleague.com/
- GitHub: https://github.com/thephpleague/fractal
- Docs: https://fractal.thephpleague.com/

## Problems it solves

- keep my PHP API's JSON output stable when the database changes
- embed related resources in a REST API response in PHP
- format API responses as JSON:API in PHP

## Features

- transformers between models and API output
- includes for nested and side-loaded relationships
- HAL, JSON:API and custom serializers
- pagination support

## Trust

Overall: 0.40 out of 1.
Signals: maintenance 0.27, adoption 0.71, momentum 0.41, community 0.79, backing 0.30, extensibility 0.00.

- latest release 0.21 11 months ago
- 3.5k GitHub stars
- 95 contributors
- backed by The League of Extraordinary Packages

Warnings:

- last commit 11 months ago

## Sources

[^1]: https://github.com/thephpleague/fractal/blob/master/LICENSE (checked 29 Nov 2026)
