Smokescreen is a PHP library for transforming data. This is ideal for transforming and serializing API responses but can be applied to many scenarios.
See also Smokescreen Laravel Library
To use Smokescreen, you define transformer for each resource, and
then call either the Smokescreen item() or collection() method to
transform the data.
Full documentation is available from: https://smokescreen-docs.netlify.com/
So vanilla.
Install package via composer:
composer require rexlabs/smokescreen
We provide a Laravel wrapper package which provides some nice conveniences for working within the Laravel framework: rexlabs/laravel-smokescreen
See the Github repository for more information:
To run phpunit tests:
composer run testsFeel free to add more tests.
Great question, thanks for asking. Our team racked our brain for several hours to come up with the perfect name for this package. In the end we went with Smokescreen because there is a transformer named smokescreen and it sounds cool.
We took all the good ideas from Fractal, and made it more extensible and safer for children.
Pull-requests are welcome. Please ensure code is PSR compliant. Smokescreen on Github
Talk to team #phoenix, or one of these people: