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 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

Technical Evaluation

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.

  • Which Symfony versions and PHP versions are actually supported and CI-tested? Does it pass on Symfony 7 / PHP 8.3+?
  • Which league/fractal major does it pin, and how does that constrain our upgrade path?
  • Does it expose the Manager, TransformerAbstract include parsing, and paginator adapters as container services, or does it require manual wiring anyway?
  • What does it add over samj/fractal-bundle (the port source) — and is the original abandoned?
  • Are serializers (ArraySerializer, DataArraySerializer, JsonApiSerializer) configurable at runtime or only at compile time?
  • Is there any include/eager-load caching (Fractal supports this) to prevent N+1 at the transformation layer?
  • Test coverage and last-commit date; any open issues referencing framework-version breakage?

Integration Approach

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.

  1. Spike in a throwaway branch: install, wire one transformer, one include, one paginated collection, one JSON:API response.
  2. Verify the paginator adapter matches our pagination library (Pagerfanta vs. Doctrine vs. custom).
  3. Compare output byte-for-byte against the current response shape.
  4. Only then run a supply-chain/SCA review and decide build-vs-wrap.
  5. Roll out endpoint-by-endpoint behind the adapter, starting read-only.

Operational Impact

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.

  • DI container fails to compile after a Symfony upgrade — hard outage at boot, not at request time.
  • league/fractal version conflict blocks a framework security patch.
  • Missing/lazy-loaded relations cause silent N+1 under include requests, invisible in dev, expensive in prod.
  • Paginator adapter mismatch produces subtly wrong meta/links blocks that pass tests but break clients.
  • Transformer exceptions surface as 500s unless the bundle exposes Fractal's error handling for customization.

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.

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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast