Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Fractal Laravel Package

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.

View on GitHub
Deep Wiki
Context7
0.18.0

Enhancements

  • Allow PHPUnit 7+ where available - Thanks @ramsey
  • Changed the paginator to not call $paginator->getPaginate() in PhalconFrameworkPaginatorAdapter constructor - Thanks @niden
  • Output an object for attributes when none are provided instead of an array in JsonApiSerializer - Thanks @BastianHofmann
  • Include meta key for relationships in JsonApiSerializer - Thanks @rawaludin
  • Allow self link to override defaults in JsonApiSerializer - Thanks @biggator
  • Preserve numeric keys when converting Scopes to arrays by using array union instead of array_merge - Thanks @andrewtweber
  • Output an object for links when none are provided instead of an array in ArraySerializer pagination - Thanks @basavind
  • Allow arrays for field lists in $fractal->parseFieldsets() - Thanks @flugger
0.17.0

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.0

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.0

Enhancements

  • Custom links in serializer
  • PhalconPHP Paginator
  • tested on 7.1
0.14.0

Added

  • null() method for serializing null resource.
  • Adds pagination to JsonApiSerializer
  • Added JSON-API serializer collection links

Enhancements

  • Fix issue including relationships on collections
  • TransformerAbstract now returns a ResourceInterface
  • getIncludeParams now always return ParamBag
  • cody styling, method naming and docs
0.13.0

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.0

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() and getTransformer() from League\Fractal\Resource\Collection as they were already defined in ResourceAbstract.
0.11.0

Added

  • Added League\Fractal\Pagination\PagerfantaPaginatorAdapter to support Pagerfanta
  • Added League\Fractal\Pagination\ZendFrameworkPaginatorAdapter to support Zend Framework Paginator

Fixed

  • Now JSON-API linked items will be unique based on their ID Issue #126
0.10.0

Added

  • Added 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.

Fixed

  • Removed PaginatorInterface::getPaginator() as it was used anymore. Issue #101
  • Manager::createData() argument 1 now hints against ResourceInterface not ResourceAbstract.
0.9.1

Fixed

  • Using ArraySerializer without a resource key would lead to an empty string as a key in JSON. Issue #78
0.9.0

Added

  • Implemented serializer methods for item and collection separately Issue #71
0.8.3

Added

  • Default Includes no longer need to be in Available Includes. Issue #58
0.8.2

Fixed

  • A null value for Manager::parseIncludes() could have weird results
0.8.1

Added

  • Make ResourceAbstract implement ResourceInterface

Fixed

  • Fixed tests for Laravel 4.2 usage
0.8.0

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() 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)
  • Made all pagination (paginators and cursors) use meta output logic, so it sits with your custom meta data
  • Moved League\Fractal\Cursor\Cursor and League\Fractal\Cursor\CursorInterface into League\Fractal\Pagination
0.7.0

Added

  • Added Cursor, as a different approach to paginating large data sets
  • Switched from PSR-0 to PSR-4
0.6.0

Added

  • Adds a PaginatorInterface, with a IlluminatePaginatorAdapter to let Fractal be framework agnostic
0.5.1

Fixed

  • Fixed PHP 5.3 support. Short array syntax will be the death of me
0.5.0

Added

  • Added Collection::setPaginator().

Removed

  • Removed PaginatedCollection, use Collection::setPaginator() instead.
0.4.6

Added

  • Allow $defaultEmbed to be enabled in a transformer, to always embed without requesting
Next

Enhancements

  • Add links for all available includes to JsonApiSerializer #331 - Thanks @matt-allan
  • Implement interface \JsonSerializable in Scopes to allow for direct usage with json_encode()
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport