samj/fractal-bundle
Symfony bundle integrating League\Fractal for transforming API data with transformers, serializers, and includes. Fractal's manager, serializers, and transformers are wired through Symfony's DI container, so you can produce consistent, well-structured JSON responses for your REST API.
Framing correction up front: despite the request describing this as a "Laravel/PHP package," samj/fractal-bundle is a Symfony2 bundle, not a Laravel package. It exists to wire Symfony's service container into League Fractal transformers so transformers can receive constructor dependencies. There is no Laravel service provider, no facade, no config publishing. This distinction is the single most important finding in the evaluation, because it determines whether the package is merely stale or categorically unusable for our stack.
Architecture fit. The underlying library, league/fractal, is sound: a transformation/presentation layer for API output with support for includes, embedded resources, serializers, and pagination adapters. The bundle adds only one thing of substance — dependency injection into transformer classes. That is a genuinely useful convenience in a Symfony 2 codebase where autowiring was immature, but it is a thin layer. On a Laravel or modern Symfony stack, the container can autowire transformer constructors natively, so the bundle's entire value proposition collapses into roughly a few dozen lines of service-provider or service-configuration code we could own ourselves.
Integration feasibility. Poor. The bundle is archived, last released 2020-06-19, with 27 stars and zero dependents. Zero dependents is the most damning signal: no downstream project in the ecosystem validates that this thing installs and runs against anything. It almost certainly constrains league/fractal to a 0.x line and targets Symfony 2.x service definition conventions — a framework branch that has been end-of-life since 2018. Installing it alongside a modern PHP runtime (8.x) and a supported Symfony or Laravel release would likely fail Composer resolution outright, or succeed only by pinning transitive dependencies to versions we do not want to defend in a security review.
Technical risk: high.
Key questions I would need answered before any decision:
Stack fit. None for a Laravel codebase. Marginal-to-poor for a modern Symfony codebase. Acceptable only inside an existing Symfony 2.x application that already depends on it and cannot be upgraded this quarter — and even then, only as a frozen, quarantined dependency.
Recommended path: do not integrate the bundle. Integrate Fractal directly, if at all.
League\Fractal\Manager as a singleton in our own container configuration.Migration path for an existing install.
services.yaml with autowiring).league/fractal to a supported major version, adjusting serializers and include handling as needed.Compatibility. Expect breakage at the Fractal major-version boundary (serializer API, resource/collection interfaces) and at the Symfony container-definition boundary. Budget for both, not one.
Sequencing. (a) Confirm stack and requirement — one week; (b) spike the native DI wiring in a branch — days, not weeks; (c) parity testing against captured responses; (d) cut over behind a feature flag; (e) remove the bundle and re-run dependency and security scans. If an existing install must stay for now, wrap it so no new code imports bundle classes, and set an explicit removal date.
Maintenance. The maintenance burden transfers entirely to us. Archiving means upstream will not accept issues, fix container incompatibilities, or address CVEs in the dependency chain. Any fix we need becomes a fork we own forever — a poor trade for a package that saves perhaps a day of wiring.
Support. No vendor, no active maintainer, no community of dependents to consult. Internal knowledge will decay quickly, and the original author owes us nothing. This is unsupportable software by any reasonable definition.
Scaling. Runtime scaling is a non-issue: Fractal is CPU-bound transformation work, trivially horizontally scalable, and often cacheable per response shape. The bundle adds container-compilation cost at boot, not request-time scaling risk. The scaling problem here is organizational — every engineer who touches the API layer must learn a dead framework's conventions.
Failure modes to expect.
Ramp-up. The conceptual learning curve is low — it is a thin bundle over a well-understood library. The real cost is the absence of documentation and the wrongness of most online examples relative to our pinned versions. Estimate a few days for an engineer familiar with the framework, plus the hidden tax of debugging a dependency nobody else in the world is running.
Bottom line for the portfolio. Do not adopt. The opportunity score, star count, dependent count, archive status, and framework mismatch all point the same direction. If an existing application depends on it, treat removal as planned technical-debt retirement with a dated milestone, and fund the small amount of application-owned DI wiring that replaces it.
How can I help you explore Laravel packages today?