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.
$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 @fluggernull() method for serializing null resource.JsonApiSerializerTransformerAbstract 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 PaginatorParamBag to replace the array passed to includes. It implements array access so keep using it as you were, or play with the new methods.PaginatorInterface::getPaginator() as it was used anymore. Issue #101Manager::createData() argument 1 now hints against ResourceInterface not ResourceAbstract.null value for Manager::parseIncludes() could have weird resultsResourceAbstract implement ResourceInterfaceResourceAbstract::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\PaginationPaginatorInterface, with a IlluminatePaginatorAdapter to let Fractal be framework agnosticCollection::setPaginator().PaginatedCollection, use Collection::setPaginator() instead.$defaultEmbed to be enabled in a transformer, to always embed without requestingJsonApiSerializer #331 - Thanks @matt-allan\JsonSerializable in Scopes to allow for direct usage with json_encode()How can I help you explore Laravel packages today?