league/fractal
Handle the output of complex data structures ready for API output.
0.20.2
69M downloads/mo
#672 most downloaded on Packagist
thephpleague/fractal
What this package is like to depend on
Last release 8 months ago
08 Dec 2025
Release timing varies
gaps range from 5 weeks to 2.8 years
Most releases are documented
notes for 25 of 39 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
39 releases · first in 2013
1 release in the last 12 months
see the full history below
Release timeline
39 releases · Nov 2013 to Dec 2025Releases
latest 39-
0.20.214 Feb 2025Release notes
Open source →What's Changed
- Fix deprecated errors in tests by @KorvinSzanto in #575
- Add Laminas paginator adapter by @KorvinSzanto in #575
Full Changelog: 0.20.1...0.20.2
-
0.20.111 Apr 2022Release notes
Open source →What's Changed
- Update supported versions in the readme by @jdreesen in #546
- Fix supported version in the readme by @jdreesen in #547
- Move stale config to the correct location by @Nyholm in #548
- Add static analysis by @matthewtrask in #549
- allow for null values to be passed to Scope by @matthewtrask in #553
- Explicitly default TransformerAbstract::currentScope to null since it's not defined in the constructor by @Plastonick in #552
New Contributors
- @jdreesen made their first contribution in #546
- @Plastonick made their first contribution in #552
Full Changelog: 0.20...0.20.1
-
0.19.224 Jan 2020 -
0.19.124 Jan 2020Release notes
Open source →- Allow sub relations with modifier #490 - thanks @onursimsek - docs
- Update TravisCI to allow failures on PHP 5.4 and 5.5 - thanks @matthewtrask
-
0.18.010 May 2019Release notes
Open source →Enhancements
- Allow PHPUnit 7+ where available - Thanks @ramsey
- Changed the paginator to not call
$paginator->getPaginate()inPhalconFrameworkPaginatorAdapterconstructor - Thanks @niden - Output an object for
attributeswhen none are provided instead of an array inJsonApiSerializer- Thanks @BastianHofmann - Include
metakey for relationships inJsonApiSerializer- Thanks @rawaludin - Allow
selflink to override defaults inJsonApiSerializer- Thanks @biggator - Preserve numeric keys when converting
Scopes to arrays by using array union instead of array_merge - Thanks @andrewtweber - Output an object for
linkswhen none are provided instead of an array inArraySerializerpagination - Thanks @basavind - Allow arrays for field lists in
$fractal->parseFieldsets()- Thanks @Flugger - Add links for all available includes to JsonApiSerializer - Thanks @matt-allan
Release notes
Open source →Enhancements
- Allow PHPUnit 7+ where available - Thanks @ramsey
- Changed the paginator to not call
$paginator->getPaginate()inPhalconFrameworkPaginatorAdapterconstructor - Thanks @niden - Output an object for
attributeswhen none are provided instead of an array inJsonApiSerializer- Thanks @BastianHofmann - Include
metakey for relationships inJsonApiSerializer- Thanks @rawaludin - Allow
selflink to override defaults inJsonApiSerializer- Thanks @biggator - Preserve numeric keys when converting
Scopes to arrays by using array union instead of array_merge - Thanks @andrewtweber - Output an object for
linkswhen none are provided instead of an array inArraySerializerpagination - Thanks @basavind - Allow arrays for field lists in
$fractal->parseFieldsets()- Thanks @flugger
-
0.17.012 Jun 2017Release notes
Open source →- Add ScopeFactoryInterface and ScopeFactory
- Add $options parameter to toJson
- Added Serializer interface to SerializerAbstract
- Add
Primitiveresource type, allows to use primitives - optimized primitive transformation when transformer is not given
Release notes
Open source →Enhancements
- Add ScopeFactoryInterface and ScopeFactory
- Add $options parameter to toJson
- Added Serializer interface to SerializerAbstract
- Add Primitive resource type, allows to use primitives
- optimized primitive transformation when transformer is not given
-
0.16.012 Mar 2017Release notes
Open source →Enhancements
- #358 Allow the ability to define meta on each object in collection
- #362 Add DoctrinePaginatorAdapter to interface with Doctrine pagination
- Implement sparse fieldset
-
0.15.028 Dec 2016Release notes
Open source →Enhancements
- Custom links in serializer
- PhalconPHP Paginator
- tested on 7.1
-
0.14.021 Jul 2016Release notes
Open source →Added
null()method for serializing null resource.- Adds pagination to
JsonApiSerializer - Added JSON-API serializer collection links
Enhancements
- Fix issue including relationships on collections
TransformerAbstractnow returns aResourceInterfacegetIncludeParamsnow always returnParamBag- cody styling, method naming and docs
-
0.13.007 Oct 2015Release notes
Open source →Added
->setData(...)and->setTransformer(...)methods to resources- able to set url include parameters with no set variables, ie.
include=comments:limit(5|1):new
Changed
- Finally, much improved JSON-API support thanks to @felixkiss
Enhancements
- Short array syntax throughout
- Test improvements
-
0.12.019 Mar 2015Release notes
Open source →Added
- Added PHP 7.0-dev support.
- Add the support for Laravel 5 paginator. Issue #153
Changed
- Now accessing the default and available includes in Transformers via getters Issue #158
Removed
- Dropped PHP 5.3 support. Use v0.11 if you're still stuck on PHP 5.3.
- Removed
getData()andgetTransformer()fromLeague\Fractal\Resource\Collectionas they were already defined inResourceAbstract.
-
0.11.010 Dec 2014Release notes
Open source →Added
- Added
League\Fractal\Pagination\PagerfantaPaginatorAdapterto support Pagerfanta - Added
League\Fractal\Pagination\ZendFrameworkPaginatorAdapterto support Zend Framework Paginator
Fixed
- Now JSON-API linked items will be unique based on their ID Issue #126
- Added
-
0.10.017 Oct 2014Release notes
Open source →Added
- Added
ParamBagto replace the array passed to includes. It implements array access so keep using it as you were, or play with the new methods.
Fixed
- Removed
PaginatorInterface::getPaginator()as it was used anymore. Issue #101 Manager::createData()argument 1 now hints againstResourceInterfacenotResourceAbstract.
- Added
-
0.9.106 Jul 2014Release notes
Open source →Fixed
- Using ArraySerializer without a resource key would lead to an empty string as a key in JSON. Issue #78
-
0.9.006 Jul 2014Release notes
Open source →Added
- Implemented serializer methods for item and collection separately Issue #71
-
0.8.314 Jun 2014Release notes
Open source →Added
- Default Includes no longer need to be in Available Includes. Issue #58
-
0.8.209 Jun 2014Release notes
Open source →Fixed
- A
nullvalue forManager::parseIncludes()could have weird results
- A
-
0.8.105 Jun 2014Release notes
Open source →Added
- Make
ResourceAbstractimplementResourceInterface
Fixed
- Fixed tests for Laravel 4.2 usage
- Make
-
0.8.027 May 2014Release notes
Open source →Added
- Added Serializers with ArraySerializer, DataArraySerializer (default) and a provisional JsonApiSerializer. See Issue #47
- Added
ResourceAbstract::setMeta('foo', mixed)to allow custom meta data - Replaced
Manager::setRequestedScopes()withManager::parseIncludes('foo,bar')which can be an array or CSV string. It can also take "Smart Syntax" such asManager::parseIncludes('bars:limit(5|1):order(-something)'), which can come from a URL query param:/foo?include=bars:limit(5|1):order(-something) - Made all pagination (paginators and cursors) use meta output logic, so it sits with your custom meta data
- Moved
League\Fractal\Cursor\CursorandLeague\Fractal\Cursor\CursorInterfaceintoLeague\Fractal\Pagination
-
0.7.031 Jan 2014Release notes
Open source →Added
- Added Cursor, as a different approach to paginating large data sets
- Switched from PSR-0 to PSR-4
-
0.6.124 Jan 2014Nothing published for this version
-
0.6.027 Dec 2013Release notes
Open source →Added
- Adds a
PaginatorInterface, with aIlluminatePaginatorAdapterto let Fractal be framework agnostic
- Adds a
-
0.5.113 Dec 2013 -
0.5.013 Dec 2013Release notes
Open source →Added
- Added
Collection::setPaginator().
Removed
- Removed
PaginatedCollection, useCollection::setPaginator()instead.
- Added
-
0.4.613 Dec 2013Release notes
Open source →Added
- Allow
$defaultEmbedto be enabled in a transformer, to always embed without requesting
- Allow
-
0.4.512 Dec 2013Nothing published for this version
-
0.4.411 Dec 2013Nothing published for this version
-
0.4.310 Dec 2013Nothing published for this version
-
0.4.210 Dec 2013Nothing published for this version
-
0.4.010 Dec 2013Nothing published for this version
-
0.3.109 Dec 2013Nothing published for this version
-
0.3.009 Dec 2013Nothing published for this version
-
0.2.109 Dec 2013Nothing published for this version
-
0.2.008 Dec 2013Nothing published for this version
-
0.1.008 Dec 2013Nothing published for this version
-
0.0.127 Nov 2013Nothing published for this version
-
0.2108 Dec 2025Nothing published for this version
-
0.2007 Mar 2022Nothing published for this version
-
0.1924 Jan 2020Release notes
Open source →- Allow sub relations with modifier #490 - thanks @onursimsek - docs
- Update TravisCI to allow failures on PHP 5.4 and 5.5 - thanks @matthewtrask