league/fractal
League Fractal is a transformation/presentation layer for API output (JSON/YAML). Define consistent serializers and transformers, type-cast fields, include related resources, and handle pagination—keeping response schemas stable as your data changes.
->getCurrentScope() after transformation completes, you'll need to update your transformer to capture the value during transformation. See #582Full Changelog: https://github.com/thephpleague/fractal/compare/0.20.2...0.21
Full Changelog: https://github.com/thephpleague/fractal/compare/0.20.1...0.20.2
Full Changelog: https://github.com/thephpleague/fractal/compare/0.20...0.20.1
This release moves Fractal up to modern PHP.
We have dropped support for 5.x with this release. Fractal now supports PHP 7.4 as the lowest PHP version. Should you need to keep using Fractal with PHP 5.x, please use 0.19.2 or lower. We will continue to patch security fixes for 0.19 but all new features and changes will be in the 0.20 release and more going forward. We will aim for a 1.0 release this summer targeting 8.x
Full Changelog: https://github.com/thephpleague/fractal/compare/0.19.2...0.20
$paginator->getPaginate() in PhalconFrameworkPaginatorAdapter constructor - Thanks @nidenattributes when none are provided instead of an array in JsonApiSerializer - Thanks @BastianHofmannmeta key for relationships in JsonApiSerializer - Thanks @rawaludinself link to override defaults in JsonApiSerializer - Thanks @biggatorScopes to arrays by using array union instead of array_merge - Thanks @andrewtweberlinks when none are provided instead of an array in ArraySerializer pagination - Thanks @basavind$fractal->parseFieldsets() - Thanks @fluggerPrimitive resource type, allows to use primitivesEnhancements:
null() method for serializing null resource.TransformerAbstract now returns a ResourceInterfacegetIncludeParams now always return ParamBag->setData(...) and ->setTransformer(...) methods to resourcesinclude=comments:limit(5|1):newgetData() and getTransformer() from League\Fractal\Resource\Collection as they were already
defined in ResourceAbstract.League\Fractal\Pagination\PagerfantaPaginatorAdapter to support PagerfantaLeague\Fractal\Pagination\ZendFrameworkPaginatorAdapter to support Zend Framework PaginatorFeatures:
ParamBag to replace the array passed to includes. It implements array access so keep using it as you were, or play with the new methods.Bugs:
PaginatorInterface::getPaginator() as it was used anymore. Issue #101Manager::createData() argument 1 now hints against ResourceInterface not ResourceAbstract.Only one change this time around: Splitting Serializer methods for item and collection to be their own thing.
This was done to fix #71 as well as make life easier for people who want to make items and collections use some different logic. For example, JsonApiSerializer wants even a single item to appear inside an array, meaning we can wrap the data in the item() serializer method to do that, but keep it as an item in case anyone wants to switch to a different serializer.
See Serializers documentation for more information.
Features:
Features:
ResourceAbstract implement ResourceInterfaceBug:
Features
ResourceAbstract::setMeta('foo', mixed) to allow custom meta dataManager::setRequestedScopes() with Manager::parseIncludes('foo,bar') which can be an array or CSV string. It can
also take "Smart Syntax" such as Manager::parseIncludes('bars:limit(5|1):order(-something)'), which can come from a URL query
param: /foo?include=bars:limit(5|1):order(-something).League\Fractal\Cursor\Cursor and League\Fractal\Cursor\CursorInterface into League\Fractal\Pagination.How can I help you explore Laravel packages today?