Download the PHP package rkulik/fractal without Composer
On this page you can find all versions of the php package rkulik/fractal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rkulik/fractal
More information about rkulik/fractal
Files in rkulik/fractal
Package fractal
Short Description Convenience wrapper for Fractal
License MIT
Homepage https://github.com/rkulik/fractal
Informations about the package fractal
fractal
Convenience wrapper for Fractal.
- Requirements
- Install
- Usage
- Item examples
- Callback for transformer
- Class for transformer
- Collection example
- Testing
- Changelog
- Contributing
- Security
- Credits
- License
Requirements
This package requires PHP 7.2 or higher.
Install
Via composer:
Usage
As this package wraps Fractal, the general usage is pretty much the same. The examples listed below demonstrate the basic workflow. For further information please refer to the Fractal documentation.
- Item examples
- Collection example
Item examples
In the following examples an item gets transformed and returned as an array. The transformation is done using either a class.
Callback for transformer
Class for transformer
Using classes for transformation is the recommended way to do so, as those transformers are easily reusable.
Collection example
Transforming and paginating a collection using a cursor can be achieved as follows:
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.