PHPackages                             eventhomes/laravel-fractalhelper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. eventhomes/laravel-fractalhelper

ActiveLibrary[API Development](/categories/api)

eventhomes/laravel-fractalhelper
================================

Compatible with Laravel 5+ and Lumen 5+.

2.0.1(6y ago)788.7kMITPHPPHP ^7.2

Since Jun 21Pushed 6y ago4 watchersCompare

[ Source](https://github.com/eventhomes/laravel-fractalhelper)[ Packagist](https://packagist.org/packages/eventhomes/laravel-fractalhelper)[ RSS](/packages/eventhomes-laravel-fractalhelper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (12)Used By (0)

Laravel 5 / Lumen 5 Fractal Api Controller
==========================================

[](#laravel-5--lumen-5-fractal-api-controller)

A simple api controller helper utilizing league fractal. You also get all the functionality provided by

Installation
------------

[](#installation)

`composer require eventhomes/laravel-fractalhelper`

Basic Usage
-----------

[](#basic-usage)

By default, this helper will use ArraySerializer(), no setup required. You may, however, need to parse the GET includes.

```
...
use EventHomes\Api\FractalHelper;

class MyController extends Controller {

    use FractalHelper;

    public function __construct(Request $request)
    {
        $this->parseIncludes($request->get('includes', ''));
    }
}
```

Customize Fractal
-----------------

[](#customize-fractal)

If you need to change the default ArraySerializer(), you can modify.

```
...
use EventHomes\Api\FractalHelper;

class MyController extends Controller {

    use FractalHelper;

    public function __construct(Manager $manager, Request $request)
    {
        $manager->setSerializer(new JsonApiSerializer);
        $this->setFractal($manager)->parseIncludes($request->get('includes', ''));
    }
}
```

Respond with item
-----------------

[](#respond-with-item)

```
public function show($id)
{
    $user = User::find($id);
    return $this->respondWithItem($user, new UserTransformer);
}
```

Respond with collection
-----------------------

[](#respond-with-collection)

```
public function index()
{
    $users = User::all();
    return $this->respondWithCollection($users, new UserTransformer);
}
```

Respond with collection, paginated
----------------------------------

[](#respond-with-collection-paginated)

```
public function index()
{
    $users = User::paginate(10);
    return $this->respondWithCollection($users, new UserTransformer);
}
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 88.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~187 days

Recently: every ~30 days

Total

10

Last Release

2303d ago

Major Versions

v0.1.4 → v1.02019-09-30

v0.1.5 → v1.1.02019-09-30

v1.1.0 → 2.0.02019-09-30

PHP version history (2 changes)0.1.0PHP &gt;=5.5.9

v1.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/78cbbdc5243e8c50348ff5c1e4c483b97e8b231cd24bf03a114a23fc61896fc7?d=identicon)[lostincode](/maintainers/lostincode)

---

Top Contributors

[![lostincode](https://avatars.githubusercontent.com/u/565885?v=4)](https://github.com/lostincode "lostincode (23 commits)")[![introwit](https://avatars.githubusercontent.com/u/11228182?v=4)](https://github.com/introwit "introwit (3 commits)")

---

Tags

apilaravellumenfractalapi controller

### Embed Badge

![Health badge](/badges/eventhomes-laravel-fractalhelper/health.svg)

```
[![Health](https://phpackages.com/badges/eventhomes-laravel-fractalhelper/health.svg)](https://phpackages.com/packages/eventhomes-laravel-fractalhelper)
```

###  Alternatives

[spatie/laravel-fractal

An easy to use Fractal integration for Laravel applications

1.9k15.1M99](/packages/spatie-laravel-fractal)[flugger/laravel-responder

A Laravel Fractal package for building API responses, giving you the power of Fractal and the elegancy of Laravel.

8901.5M5](/packages/flugger-laravel-responder)[yajra/laravel-datatables-fractal

Laravel DataTables Fractal Plugin.

966.9M29](/packages/yajra-laravel-datatables-fractal)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[cyvelnet/laravel5-fractal

A simple fractal service provider and transformer generator with model attributes for laravel &gt;=5.

79187.2k1](/packages/cyvelnet-laravel5-fractal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
