New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

bigpaulie/fractal-laravel-service

Fractal service provider for Laravel Framework
136
Install
composer require bigpaulie/fractal-laravel-service
Latest Version:v1.0.4
PHP:>=5.6.4|^7
Laravel:5
License:MIT
Last Updated:Mar 6, 2019
Links: GitHub  ·  Packagist
Maintainer: bigpaulie

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.

Related Packages

xiashaung/lumen-generator

Model, controller, provider and service generator for Lumen 5+ from DB schema

4 0
gathercontent/laravel-fractal

A Laravel Service Provider for Fractal

162,932 50
smorken/service

Services for PHP/Laravel

3,710
m4tthumphrey/fractal-laravel

Laravel bindings for the Fractal library.

2,566 4
mattkirwan/illuminate-database-silex-service-provider

A Silex specific service provider for using Illuminate Database as a standalone...

1,748 1

Version History

Version Released PHP Laravel License
v1.0.4 >=5.6.4|^7 ^5.0 MIT
v1.0.3 >=5.6.4|^7 ^5.0 MIT
v1.0.2 >=5.6.4|^7 ^5.0 MIT
v1.0.1 >=5.6.4|^7.0 ^5.0 MIT
v1.0.0 >=5.6.4 ^5.0 MIT