PHPackages                             vice/laravel-fractal - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vice/laravel-fractal

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vice/laravel-fractal
====================

Fractal helpers for Laravel 5

v0.1.1(9y ago)11.5k1[1 PRs](https://github.com/VICEMedia/laravel-fractal/pulls)MITPHPCI failing

Since Jul 13Pushed 4y ago3 watchersCompare

[ Source](https://github.com/VICEMedia/laravel-fractal)[ Packagist](https://packagist.org/packages/vice/laravel-fractal)[ RSS](/packages/vice-laravel-fractal/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (8)Versions (4)Used By (0)

Another Fractal Service Provider for Laravel 5 and Lumen
========================================================

[](#another-fractal-service-provider-for-laravel-5-and-lumen)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7aa976810fed22bf83c51ef4e7d755275924c0935906a0b8c37381b437b3eed8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766963652f6c61726176656c2d6672616374616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vice/laravel-fractal)[![Build Status](https://camo.githubusercontent.com/12956168dbbdff477c777af4baa6db8e5b2f5328a8be4de0bdba4884eba17dbc/68747470733a2f2f7472617669732d63692e6f72672f564943454d656469612f6c61726176656c2d6672616374616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/VICEMedia/laravel-fractal)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Fractal lets you present API data in a consistent way, by acting as an anti-corruption layer between your frontend and backend.

[Read up on Fractal here.](http://fractal.thephpleague.com/)

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

[](#installation)

Require this package

```
composer require vice/laravel-fractal

```

And then add the following to the service providers in `app.php`

```
Vice\LaravelFractal\FractalServiceProvider::class,

```

Usage
-----

[](#usage)

To send a JSON representation of a single entity to the frontend simply

```
public function show($id)
{
    //...

    fractalResponse()->item($thing, new ThingTransformer);
}
```

To send a JSON representation of a collection of entities to the frontend simply

```
public function index()
{
    //...

    fractalResponse()->collection($things, new ThingTransformer);
}
```

*The collection method also supports paginators, and will automatically append their state under a `meta` key*

If you need to transform data without immediately using it in a response you may inject `Vice\LaravelFractal\FractalService`into your controller / class and use it as so:

```
$json = $this->fractalService->item($thing, new ThingTransformer)->toJson();
```

Contributing
------------

[](#contributing)

Please open any issues or pull requests on GitHub. This package is maintained by

For PRs please run the style fixer (vendor/bin/php-cs-fixer fix) before submitting.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

3639d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c9842a9f873a32e2294af97cb04e26149ab64c3d754f309f4f1f2960150ca82?d=identicon)[charliekassel](/maintainers/charliekassel)

![](https://avatars.githubusercontent.com/u/5322152?v=4)[Max Brokman](/maintainers/maxbrokman)[@maxbrokman](https://github.com/maxbrokman)

---

Top Contributors

[![maxbrokman](https://avatars.githubusercontent.com/u/5322152?v=4)](https://github.com/maxbrokman "maxbrokman (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/vice-laravel-fractal/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.8k](/packages/larastan-larastan)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77018.2M127](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

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