PHPackages                             fd6130/fractal-bundle - 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. fd6130/fractal-bundle

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

fd6130/fractal-bundle
=====================

A Symfony Bundle for Fractal by League. Implements dependency injection into your transformers

4.1.1(3y ago)220.5k↓42.9%1MITPHPPHP &gt;=7.4

Since Sep 7Pushed 3y agoCompare

[ Source](https://github.com/fd6130/FractalBundle)[ Packagist](https://packagist.org/packages/fd6130/fractal-bundle)[ RSS](/packages/fd6130-fractal-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (13)Used By (0)

Fractal Bundle
==============

[](#fractal-bundle)

This bundle provides integration of [league/fractal](https://github.com/thephpleague/fractal) for Symfony. In addition it allows you to use [transformers as a services](#using-transformers-as-services).

**This is a fork version of [samjarrett/FractalBundle](https://github.com/samjarrett/FractalBundle).**

Getting Started
---------------

[](#getting-started)

Requirements:

- PHP &gt;= 7.4
- Symfony 4, 5 and 6

Install through composer:

```
composer require fd6130/fractal-bundle

```

If you are using symfony flex, it will automatic register the bundle for you.

Usage
-----

[](#usage)

You can use command `php bin/console make:fractal-transformer` to create a transformer.

Or, just create it by your own and place it in `src/Transformer`.

```
class UserTransformer extends TransformerAbstract
{
    public function transform(User $user): array
    {
        $data = [
            'id' => $user->id(),
            'name' => $user->name(),
        ];

        return $data;
    }
}

$resource = new Collection($users, UserTransformer::class);

$response = $manager->createData($resource)->toArray();
```

### Inject services to the transformers

[](#inject-services-to-the-transformers)

You can inject services to your transformer through constructor:

```
class UserTransformer extends TransformerAbstract
{
    private $entityManager;

    public function __construct(EntityManagerInterface $entityManager)
    {
        $this->entityManager = $entityManager;
    }

    public function transform(User $user): array
    {
        $data = [
            'id' => $user->id(),
            'name' => $user->name(),
        ];

        // $this->entityManager->getRepository(...)

        return $data;
    }
}
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 55.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 ~256 days

Recently: every ~211 days

Total

12

Last Release

1456d ago

Major Versions

0.3.0 → 1.0.02017-03-12

1.0.0 → 2.0.02017-10-14

2.1.0 → 3.0.02020-01-29

3.0.1 → 4.0.02020-06-19

PHP version history (5 changes)0.1.0PHP &gt;=5.3.3

0.2.0PHP &gt;=5.4

0.3.0PHP &gt;=5.6

3.0.0PHP &gt;=7.0

4.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11419744?v=4)[Vui](/maintainers/fd6130)[@fd6130](https://github.com/fd6130)

---

Top Contributors

[![samjarrett](https://avatars.githubusercontent.com/u/559397?v=4)](https://github.com/samjarrett "samjarrett (21 commits)")[![fesor](https://avatars.githubusercontent.com/u/172247?v=4)](https://github.com/fesor "fesor (8 commits)")[![dave-redfern](https://avatars.githubusercontent.com/u/1477147?v=4)](https://github.com/dave-redfern "dave-redfern (4 commits)")[![michaelcullum](https://avatars.githubusercontent.com/u/211740?v=4)](https://github.com/michaelcullum "michaelcullum (2 commits)")[![fd6130](https://avatars.githubusercontent.com/u/11419744?v=4)](https://github.com/fd6130 "fd6130 (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![beebeb](https://avatars.githubusercontent.com/u/100330779?v=4)](https://github.com/beebeb "beebeb (1 commits)")

---

Tags

bundlefractalleaguephpsymfonytransformer

### Embed Badge

![Health badge](/badges/fd6130-fractal-bundle/health.svg)

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

###  Alternatives

[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

34010.4M15](/packages/winzou-state-machine-bundle)[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[sylius/taxonomy-bundle

Flexible categorization system for Symfony.

26388.2k7](/packages/sylius-taxonomy-bundle)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[sylius/addressing-bundle

Addressing and zone management for Symfony applications.

33221.4k3](/packages/sylius-addressing-bundle)[sylius/inventory-bundle

Flexible inventory management for Symfony applications.

19176.7k4](/packages/sylius-inventory-bundle)

PHPackages © 2026

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