New

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

hesto/fractalfy

Laravel wrapper for Fractal.
1,609

Larablocks Analysis

hesto/fractalfy works with Laravel 5 (latest release v1.0.2, Feb 13, 2017), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: Feb 13, 2017)
  • 0 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Feb 13, 2017.
  • No releases in the last 12 months.
  • First released: Jan 15, 2017.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require hesto/fractalfy
Latest Version:v1.0.2
PHP:>=5.5.9
Laravel:5
License:MIT
Last Updated:Feb 13, 2017
Links: GitHub  ·  Packagist
Maintainer: Hesto

Fractalfy

Laravel Wrapper for Fractal

Usage

Step 1: Install Through Composer

composer require hesto/fractalfy

Step 2: Register Service Provider

Add your new provider to the providers array of config/app.php:

  'providers' => [
      // ...
      Hesto\Fractalfy\FractalfyServiceProvider::class,
      // ...
  ],

Fractal methods

Extend your controller with FractalfyController

class DashboardController extends FractalfyController
{
    ...
}

Return collection

$users = Users::all();
return $this->fractal
    ->collection($users, new UserTransformer)
    ->get();

Return resource with pagination

$users = Users::all();
return $this->fractal
    ->paginate($users, new UserTransformer)
    ->get();

Fractalfy Helpers

Use Fractalfy Helpers (already included in FractalfyController)

Popular

return $this->respondOK();
return $this->respondNotFound();
return $this->respondUnauthorized();
return $this->respondUnprocessable();
return $this->respondBadRequest();
return $this->respondWithSuccess(200); //any success code
return $this->respondWithError(400); //any success code

Other

return $this->respondOK($message); //pass message to respond
return $this->setMessage($message)->respondOK();
return $this->setMessage($message)->setStatusCode($statuscode)->respondWithSuccess(); 
return $this->setMessage($message)->setStatusCode($statuscode)->respondWithError(); 

Related Packages

ellipsesynergie/api-response

Simple package to handle response properly in your API

1,444,398 370
purwandi/responder

Transform your laravel eloquent model using fluent fractal API

94 0
yajra/laravel-datatables-fractal

Laravel DataTables Fractal Plugin.

8,742,196 97
cyvelnet/laravel5-fractal

A simple fractal service provider and transformer generator with model attribute...

190,797 79
eilander/api

Laravel 5 api package

14 1

Version History

Version Released PHP Laravel License
v1.0.2 >=5.5.9 ~5.1.0|~5.2.0|~5.3.0|~5.4.0 MIT
v1.0.1 >=5.5.9 ~5.1.0|~5.2.0|~5.3.0 MIT
v1.0.0 >=5.5.9 ~5.1.0|~5.2.0|~5.3.0 MIT