2017 © Pedro Peláez
 

library smokescreen

Smokescreen is a PHP library for transforming and serializing data such as API responses.

image

rexlabs/smokescreen

Smokescreen is a PHP library for transforming and serializing data such as API responses.

  • Thursday, July 5, 2018
  • by itsmejodie
  • Repository
  • 16 Watchers
  • 3 Stars
  • 358 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 107 % Grown

The README.md

Smokescreen

License: MIT Packagist Build Status Code Coverage StyleCI, (*1)

Overview

Smokescreen is a PHP library for transforming data. This is ideal for transforming and serializing API responses but can be applied to many scenarios., (*2)

See also Smokescreen Laravel Library, (*3)

Features

  • Simple intuitive interface
  • Transform any type of data (arrays, models, etc.)
  • Embedding of related resources (aka. includes)
  • Declarative includes
  • Includes auto-wiring
  • Declarative fields (including sparse field sets)
  • Eager loading
  • Flexible transformation and serialization
  • Support for lazy loading
  • No other dependencies

Usage

To use Smokescreen, you define transformer for each resource, and then call either the Smokescreen item() or collection() method to transform the data., (*4)

Full documentation is available from: https://smokescreen-docs.netlify.com/, (*5)

Requirements and dependencies

  • PHP >= 7.0

So vanilla., (*6)

Installation

Install package via composer:, (*7)

composer require rexlabs/smokescreen, (*8)

Laravel package

We provide a Laravel wrapper package which provides some nice conveniences for working within the Laravel framework: rexlabs/laravel-smokescreen, (*9)

See the Github repository for more information:, (*10)

Tests

To run phpunit tests:, (*11)

composer run tests

Feel free to add more tests., (*12)

FAQ

Why call it "Smokescreen"

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., (*13)

Why wouldn't I just use Fractal

We took all the good ideas from Fractal, and made it more extensible and safer for children., (*14)

Contributing

Pull-requests are welcome. Please ensure code is PSR compliant. Smokescreen on Github, (*15)

Who do I talk to?

Talk to team #phoenix, or one of these people:, (*16)

About

  • Author: Jodie Dunlop
  • License: MIT
  • Copyright (c) 2018 Rex Software Pty Ltd

The Versions

05/07 2018

dev-master

9999999-dev

Smokescreen is a PHP library for transforming and serializing data such as API responses.

  Sources   Download

MIT

The Development Requires

by Jodie Dunlop

api json serializer transform hypermedia webservices fractal smokescreen

05/07 2018

2.0.0

2.0.0.0

Smokescreen is a PHP library for transforming and serializing data such as API responses.

  Sources   Download

MIT

The Development Requires

by Jodie Dunlop

api json serializer transform hypermedia webservices fractal smokescreen

21/05 2018

1.1.0

1.1.0.0

Smokescreen is a PHP library for transforming and serializing data such as API responses.

  Sources   Download

MIT

The Development Requires

by Jodie Dunlop

api json serializer transform hypermedia webservices fractal smokescreen

20/04 2018

dev-feature/declarative-props

dev-feature/declarative-props

Smokescreen is a PHP library for transforming and serializing data such as API responses.

  Sources   Download

MIT

The Development Requires

by Jodie Dunlop

api json serializer transform hypermedia webservices fractal smokescreen

08/03 2018

1.0.1

1.0.1.0

Smokescreen is a PHP library for transforming and serializing data such as API responses.

  Sources   Download

MIT

The Development Requires

by Jodie Dunlop

api json serializer transform hypermedia webservices fractal smokescreen

05/03 2018

1.0.0

1.0.0.0

  Sources   Download

The Development Requires

by Jodie Dunlop