Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Fractal Bundle

Fractal Bundle Laravel Package

somnambulist/fractal-bundle

A Laravel bundle that integrates League Fractal, adding service providers, configuration and helpers so you can transform API responses with Fractal serializers, includes and pagination using familiar framework conventions.

View on GitHub
Deep Wiki
Context7

A port of samj/fractal-bundle for integrating TheLeagues Fractal package with Symfony

Frequently asked questions about Fractal Bundle
Is somnambulist/fractal-bundle a Laravel package?
No. It is a Symfony bundle, a port of samj/fractal-bundle, and its entire purpose is wiring league/fractal's Manager, serializers, and include parsing into Symfony's DI container and configuration tree. Bundles rely on Bundle classes, Extension::load(), and Configuration trees, none of which Laravel's container consumes, so architecture fit on a Laravel stack is effectively zero. Laravel developers looking for Fractal integration should use spatie/laravel-fractal instead.
What is the Laravel equivalent of fractal-bundle?
spatie/laravel-fractal is the widely adopted Laravel package for Fractal integration, and it is orders of magnitude more used than this bundle. Alternatively, standardize on Eloquent API Resources and skip Fractal entirely if you only need simple response shaping. Either choice avoids pulling a Symfony-only wrapper into a Laravel rendering path.
How do I install somnambulist/fractal-bundle?
Install it with Composer, then register the bundle in your Symfony application's bundle configuration (typically config/bundles.php) and import its configuration under the extension's root key. Because adoption is near zero, do not assume Symfony Flex recipes exist, so plan for manual registration and a config file. Verify the exact service IDs and config root key from the package's own documentation before wiring anything.
What does this bundle actually add over league/fractal on its own?
It adds configuration sugar, service autowiring for the Fractal Manager, and include-parsing plumbing tied into Symfony's container. The substantive transformation behavior, serializers, includes, and paginator adapters all live in league/fractal itself, which is framework-agnostic and can be wired manually in roughly thirty lines of service definitions. Adopting the bundle buys convenience at the cost of an extra dependency in your rendering path that you do not control.
Which Symfony and PHP versions does it support?
The available evaluation material does not confirm a tested compatibility matrix, and given three stars and zero dependents there is little downstream ecosystem pressure exercising it against new Symfony or PHP releases. Before committing, inspect composer.json constraints and the CI configuration for explicit Symfony DI, HttpKernel, and PHP version coverage. Treat any unresolvable intersection across PHP, Symfony, league/fractal, and serializer choice as a hard stop.
Does it work with Symfony 7 and PHP 8.3 or later?
There is no confirmed evidence in the provided context that it passes on Symfony 7 with PHP 8.3 or newer. A Symfony major bump can break bundle compilation, and with a single maintainer there may be no one to patch it quickly. Validate this in a throwaway branch before it becomes load-bearing, and check the last commit date and any open issues referencing framework-version breakage.
Is it a drop-in replacement for samj/fractal-bundle?
No, it is a fork rather than a drop-in. Expect namespace changes, a different configuration root key, and different service IDs, which means a config-and-service-definition rewrite plus a regression pass over every endpoint that uses a transformer. Also check whether the original samj/fractal-bundle is abandoned, since that affects your long-term migration options.
Which league/fractal versions does it pin, and does that limit upgrades?
The pinned league/fractal major is defined in the package's composer.json and should be checked explicitly, because it constrains your upgrade path for the underlying transformer library. Fractal itself has a slowing release cadence, so you would be layering a lightly maintained wrapper over a slowing upstream. Pin league/fractal, Symfony DI and HttpKernel, PHP, and your serializer in an explicit four-way matrix before adopting.
Does the bundle expose Fractal's Manager, include parsing, and paginator adapters as container services?
The bundle's stated role is to wire the Manager, serializers, and include parsing into Symfony's DI container and config tree, but the provided context does not confirm every one of those is autowireable without manual services. Verify specifically whether TransformerAbstract include parsing and paginator adapters are exposed as services or require additional definitions. Also confirm that the paginator adapter matches your pagination library, whether Pagerfanta, Doctrine, or custom.
Is somnambulist/fractal-bundle safe to depend on in production?
Risk here is significant: three stars and zero dependents is an adoption signal of near-zero rather than a small-but-stable one, meaning no downstream ecosystem is exercising it against new releases. The maintainer is effectively a single-person shop, so bus factor is one, and a Symfony major bump could break bundle compilation with no one available to patch it. Treat the bundle as an optional convenience rather than a load-bearing dependency, keep a thin internal adapter so callers depend on your interface, and consider depending on league/fractal directly instead.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console