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.
Architecture fit. The first thing to flag is a framing mismatch: this is not a Laravel package. somnambulist/fractal-bundle is a Symfony bundle (a port of samj/fractal-bundle) whose entire purpose is to wire league/fractal's Manager, serializers, and include-parsing into Symfony's DI container and configuration tree. If the target stack is Laravel, the architecture fit is effectively zero — bundles rely on Bundle classes, Extension::load(), and Configuration trees, none of which Laravel's container consumes. If the target stack is Symfony, the fit is idiomatic but the bundle is thin glue: the substantive value lives in league/fractal itself, which is framework-agnostic and can be wired manually in ~30 lines of service definition.
Integration feasibility. High effort-to-value ratio. Because the bundle is a convenience wrapper, the cheapest path is almost always to depend on league/fractal directly and register a Manager service yourself, or — on Laravel — to use spatie/laravel-fractal (orders of magnitude more adopted) or native API Resources. Adopting this package buys configuration sugar and service autowiring, at the cost of an extra dependency in the critical rendering path that you do not control.
Technical risk. This is the dominant concern. Three stars and zero dependents is not a "small but stable" signal; it is an adoption signal of near-zero, which means no downstream ecosystem is exercising it against new Symfony/PHP releases. The maintainer org (somnambulist-tech) is a single-person shop with a portfolio of packages, so bus factor is 1. Fractal itself has a slowing release cadence, so we would be layering an unmaintained wrapper over a slowing upstream. Risks compound: a Symfony major bump can break bundle compilation, and there may be no one to patch it.
Key questions.
league/fractal major does it pin, and how does that constrain our upgrade path?Manager, TransformerAbstract include parsing, and paginator adapters as container services, or does it require manual wiring anyway?samj/fractal-bundle (the port source) — and is the original abandoned?ArraySerializer, DataArraySerializer, JsonApiSerializer) configurable at runtime or only at compile time?Stack fit. If the platform is Laravel: stop here and use league/fractal + spatie/laravel-fractal, or standardize on Eloquent API Resources and skip Fractal entirely. If the platform is Symfony: the bundle is plausible but should be treated as an optional convenience, not a load-bearing dependency.
Migration path. If arriving from samj/fractal-bundle, expect namespace changes, a different config root key, and different service IDs — this is a fork, not a drop-in. Budget a config-and-service-definition rewrite plus a regression pass over every endpoint that uses a transformer. If arriving from raw league/fractal, the bundle removes boilerplate but inverts control of service construction; keep a thin internal adapter so callers depend on our interface, not the bundle's.
Compatibility. Build an explicit matrix before committing: PHP version × Symfony DI/HttpKernel version × league/fractal version × serializer in use. Pin all four. Treat any unresolvable intersection as a hard stop.
Sequencing.
Maintenance. Assume we own this. With zero dependents and a single maintainer, the realistic posture is "vendor it or fork it." Budget for a periodic manual compatibility check each time Symfony or PHP is upgraded — work that would otherwise be absorbed by the community.
Support. GitHub issues only; no commercial backing, no SLA, no security-response process we can point an auditor at. For a regulated or long-lived product, that is a documented governance gap.
Scaling. The bundle is not the bottleneck; Fractal's transformation pass is. Two scaling concerns live in Fractal, not the bundle: include-driven N+1 queries if relations are not eager-loaded upstream, and per-item transformer overhead on large collections. Choose the serializer deliberately — JsonApiSerializer produces materially heavier payloads and more CPU than DataArraySerializer, and that decision outlives the bundle choice.
Failure modes.
league/fractal version conflict blocks a framework security patch.meta/links blocks that pass tests but break clients.Ramp-up. Low for a Symfony developer: bundle conventions are standard, and Fractal's core vocabulary (transformer, include, serializer, paginator) is a one-day onboarding. The real ramp is serializer choice and include discipline — a week to get JSON:API-shaped output correct and performant, longer if the team is new to eager-loading discipline.
Recommendation. Do not adopt as a strategic dependency. Depends on league/fractal directly, wrap it behind an internal adapter, and revisit only if the upstream demonstrates sustained maintenance and version support.
How can I help you explore Laravel packages today?