PHPackages                             nordsoftware/lumen-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. [API Development](/categories/api)
4. /
5. nordsoftware/lumen-fractal

AbandonedArchivedLibrary[API Development](/categories/api)

nordsoftware/lumen-fractal
==========================

Fractal module for the Lumen PHP framework.

1.3.0(10y ago)2634.6k↓50%1[1 issues](https://github.com/nordsoftware/lumen-fractal/issues)[1 PRs](https://github.com/nordsoftware/lumen-fractal/pulls)MITPHPPHP &gt;=5.6

Since Mar 5Pushed 8y ago35 watchersCompare

[ Source](https://github.com/nordsoftware/lumen-fractal)[ Packagist](https://packagist.org/packages/nordsoftware/lumen-fractal)[ RSS](/packages/nordsoftware-lumen-fractal/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (6)Versions (8)Used By (0)

Lumen Fractal
=============

[](#lumen-fractal)

[![Build Status](https://camo.githubusercontent.com/22c89e3af3ba7b5921f72308fe4ca6bae345b1ce7fae33360191b4e12cd219fa/68747470733a2f2f7472617669732d63692e6f72672f6e6f7264736f6674776172652f6c756d656e2d6672616374616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nordsoftware/lumen-fractal)[![Coverage Status](https://camo.githubusercontent.com/a3020ceb947d7cecedd95eeb0aa400505c7c8cc2ccd1e58a5809197941298864/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e6f7264736f6674776172652f6c756d656e2d6672616374616c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nordsoftware/lumen-fractal?branch=master)[![Code Climate](https://camo.githubusercontent.com/5e42f6704719ad26c9bce8b3e346195f2193d16b535002b7f2bb7cca4da91890/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e6f7264736f6674776172652f6c756d656e2d6672616374616c2f6261646765732f6770612e737667)](https://codeclimate.com/github/nordsoftware/lumen-fractal)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f168d6ca86f56211bb34862e143b755ccbef18032bd982518297d6b25628542a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e6f7264736f6674776172652f6c756d656e2d6672616374616c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/nordsoftware/lumen-fractal/?branch=master)[![StyleCI](https://camo.githubusercontent.com/7361af28da12338ca7c0de3d13a125b43c66b90afaf3fd9c3e0d1d0de16f07ad/68747470733a2f2f7374796c6563692e696f2f7265706f732f35333139393231342f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/53199214)[![Latest Stable Version](https://camo.githubusercontent.com/cdfb9cc1a4d8e2cf09afd9c83e900c007c185f8ffb5863b80b6321becb2f67ca/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7264736f6674776172652f6c756d656e2d6672616374616c2f76657273696f6e)](https://packagist.org/packages/nordsoftware/lumen-fractal)[![Total Downloads](https://camo.githubusercontent.com/fca0f687da2ba27de6377b9c3516e7ea0b70e67ae89b4376e6cbc51a6fa11d4e/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7264736f6674776172652f6c756d656e2d6672616374616c2f646f776e6c6f616473)](https://packagist.org/packages/nordsoftware/lumen-fractal)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

[Fractal](http://fractal.thephpleague.com/) module for the [Lumen PHP framework](http://lumen.laravel.com/).

Requirements
------------

[](#requirements)

- PHP 5.6 or newer
- [Composer](http://getcomposer.org)
- [Lumen](https://lumen.laravel.com/) 5.3 or newer

Setup
-----

[](#setup)

### Installation

[](#installation)

Run the following command to install the package through Composer:

```
composer require nordsoftware/lumen-fractal

```

### Configuration

[](#configuration)

Copy the configuration template in `config/fractal.php` to your application's `config` directory and modify according to your needs. For more information see the [Configuration Files](http://lumen.laravel.com/docs/configuration#configuration-files) section in the Lumen documentation.

Available configuration options:

- **default\_serializer** - *Default serializer to use for serialization, defaults to null*

### Bootstrap

[](#bootstrap)

Add the following lines to `bootstrap/app.php`:

```
$app->register('Nord\Lumen\Fractal\FractalServiceProvider');
```

Optionally you can also use `Nord\Lumen\Fractal\FractalMiddleware` to parse includes automatically from the request.

```
$app->middleware([
	.....
	'Nord\Lumen\Fractal\Middleware\FractalMiddleware',
]);
```

Usage
-----

[](#usage)

You can now use `Nord\Lumen\Fractal\FractalService` to access Fractal anywhere in your application.

Here is a few examples on how you can serialize data if you are using Eloquent:

```
public function getBook(FractalService $fractal, $id) {
  // load the book model ...

  return response()->json($fractal->item($book, new BookTransformer)->toArray());
}
```

```
public function listBooks(FractalService $fractal) {
  // load the book collection ...

  return response()->json($fractal->collection($books, new BookTransformer)->toArray());
}
```

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

[](#contributing)

Please read the [guidelines](.github/CONTRIBUTING.md).

Running tests
-------------

[](#running-tests)

Clone the project and install its dependencies by running:

```
composer install
```

Run the following command to run the test suite:

```
vendor/bin/codecept run unit
```

License
-------

[](#license)

MIT, see [LICENSE](LICENSE).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 53.3% 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 ~126 days

Recently: every ~152 days

Total

6

Last Release

3087d ago

Major Versions

1.3.0 → 2.0.x-dev2017-11-28

PHP version history (2 changes)1.2.0PHP &gt;=5.6

2.0.x-devPHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab3becb3323ceb956c661f3e6ef4312dcd00ec4ba03d1bba5fcef793f5c4286d?d=identicon)[crisu83](/maintainers/crisu83)

![](https://www.gravatar.com/avatar/2f766f3d06300e4e58806cac328ec6774408e2782497f3624f6112e0838bd057?d=identicon)[soderluk](/maintainers/soderluk)

![](https://www.gravatar.com/avatar/0946a262e18034427b1a75b8f2b9edc25395f33e5f514c616de79c69312e2b92?d=identicon)[kryysler](/maintainers/kryysler)

---

Top Contributors

[![hugovk](https://avatars.githubusercontent.com/u/1324225?v=4)](https://github.com/hugovk "hugovk (16 commits)")[![cniska](https://avatars.githubusercontent.com/u/1044868?v=4)](https://github.com/cniska "cniska (7 commits)")[![soderluk](https://avatars.githubusercontent.com/u/6086071?v=4)](https://github.com/soderluk "soderluk (4 commits)")[![kryysler](https://avatars.githubusercontent.com/u/3352265?v=4)](https://github.com/kryysler "kryysler (2 commits)")[![Jalle19](https://avatars.githubusercontent.com/u/1106133?v=4)](https://github.com/Jalle19 "Jalle19 (1 commits)")

---

Tags

lumenlumen-fractallumen-php-frameworkphpjsonapilaravellumenserializationfractal

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/nordsoftware-lumen-fractal/health.svg)

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

###  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)[ellipsesynergie/api-response

Simple package to handle response properly in your API

3751.4M20](/packages/ellipsesynergie-api-response)[nilportugues/laravel5-json-api

Laravel 5 JSON API Transformer Package

31232.4k1](/packages/nilportugues-laravel5-json-api)[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)
