LaravelPackages.net
Acme Inc.
Toggle sidebar
bigpaulie/fractal-laravel-service

Fractal service provider for Laravel Framework

136
0
v1.0.4
About bigpaulie/fractal-laravel-service

bigpaulie/fractal-laravel-service is a Laravel package for fractal service provider for laravel framework. It currently has 0 GitHub stars and 136 downloads on Packagist (latest version v1.0.4). Install it with composer require bigpaulie/fractal-laravel-service. Discover more Laravel packages by bigpaulie or browse all Laravel packages to compare alternatives.

Last updated

Fractal service provider for Laravel Framework

Build Status Latest Stable Version Total Downloads Latest Unstable Version

This is a simple service provider for Laravel 5.x

Installation

The preferred way to install the package is via composer

composer require bigpaulie/fractal-laravel-service

After installing the package you need to add the service provider to your config/app.php

bigpaulie\fractal\FractalServiceProvider::class

Usage

First you need to create your transformers afterwards you can use the response helper with the corresponding macro

Collections
return response()->collection($collection, new YourTransformer());
Collections with pagination
return response()->collection($collection, new YourTransformer(), $collection);
Items
return response()->item($item, new YourTransformer());
Exceptions
return response()->exception($exception, new YourTransformer());

Contribution

If you want to contribute to this project, please fork and submit a pull request.

Comments