rmzamora/formatter-bundle
A Laravel/PHP formatter bundle that provides reusable formatting helpers for consistent, clean output across models, views, and APIs.
Architecture fit. Poor — effectively zero for a Laravel codebase. rmzamora/formatter-bundle is a fork of Sonata's SonataFormatterBundle, a Symfony bundle, not a Laravel package. Bundles are a Symfony distribution unit: they are registered in the kernel (bundles.php / AppKernel), expose a Bundle class, a DI Extension with a Configuration tree, and contribute tagged services, event listeners, and Twig extensions to the Symfony container. Laravel has no bundle concept and no kernel hook for that lifecycle. This package ships no service provider, no facade, no config publishable, and no Illuminate dependency — there is no integration surface for Laravel to attach to.
What it actually does. It provides content formatting for SonataAdminBundle text fields: a formatter pool (markdown, textile, raw HTML), a sonata_formatter Twig filter, an admin extension adding a per-field "formatter" selector, and persistence of the chosen formatter alongside the content. Its reason for existing is Sonata Admin UX, not generic text transformation — so even in Symfony, its value is tightly coupled to the Sonata admin stack.
Integration feasibility. Low. A composer require into a modern Laravel app would attempt to pull symfony/framework-bundle, sonata-project/admin-bundle, twig/twig, and a Markdown bundle. Given the fork's era, constraints are likely PHP 5.6/7.x and Symfony 2.8/3.x, which directly conflict with Laravel 9+ (PHP 8.1+, Symfony ^6/^7 components via illuminate/*). Outcomes are either a hard resolution failure or — worse — a forced downgrade of shared Symfony components that silently destabilizes the framework. The only genuinely reusable artifact is the pattern (formatter interface + registry + per-field selection), not the code.
Technical risk. High.
sonata-project/*, knp-markdown-bundle) that will themselves be unpatched.Key questions. (1) What problem are we solving — Markdown rendering for user content, or per-field formatter selection in an admin UI? (2) Do we operate any Symfony/Sonata estate at all, or is "Laravel/PHP" the entire footprint? (3) If a legacy Sonata app exists, why would we use this fork rather than upstream sonata-project/formatter-bundle? (4) What is our policy on archived dependencies in production composer.json, and does this pass a security review? (5) Is the 6.81 opportunity score reflecting a real need ("formatting is common") or this artifact's viability? The latter is near zero.
Stack fit. None for Laravel. For a hypothetical Symfony/Sonata estate, fit is moderate — but the correct dependency is upstream Sonata, not a dormant fork. In Laravel, the equivalent capability is composed from maintained libraries: league/commonmark (Markdown → HTML, extensible, actively maintained), spatie/laravel-markdown for Blade-side rendering, and mews/purifier or ezyang/htmlpurifier for sanitization. The bundle's DI formatter pool maps cleanly to a Laravel singleton manager; its Twig filter maps to a Blade directive or a HtmlString-returning helper; its per-field selection maps to a model cast or accessor.
Migration path. There is no migration from this package — there is a reimplementation of its concept, which is small:
Formatter interface with transform(string $text): string.FormatterManager bound as a singleton, reading config/formatters.php for name → class mappings.@format('markdown', $text) plus a FormatsContent trait/cast for per-model formatter selection.This is roughly 1–2 engineer-days and produces code the team can actually maintain.
Compatibility. Assume incompatible until proven otherwise: expect PHP <8.0, Symfony 2/3, Twig 1/2, Sonata Admin ^3. Modernizing it is a fork-and-rewrite project against an archived upstream — i.e., we become the maintainer of a dead package.
Sequencing.
sonata-project/formatter-bundle there, isolated from the Laravel estate.league/commonmark + purifier in a Laravel service (half a day), and if more than one service needs identical formatting behavior, promote it to an internal package.Maintenance. Archived means the maintenance burden transfers entirely to us on day one: PHP upgrades, security advisories, and dependency drift are all ours. composer audit will flag it and its transitive tree indefinitely. With zero dependents, there is no shared maintenance and no upstream to send patches to.
Support. No active maintainer, no responsive issue tracker, no documentation beyond Sonata's (which describes a different version). Internal support means reverse-engineering bundle conventions from an obsolete framework generation — the opposite of leverage.
Scaling. Not the constraint. The formatters are stateless and CPU-bound on content length; horizontal scaling is trivial. The real concern is whether the code runs at all in our runtime. If any piece were reused, cache rendered HTML per content version so parsing happens once per edit, not once per read.
Failure modes.
Ramp-up. Negative. Nothing an engineer learns here transfers to the Laravel codebase; the bundle's conventions are a dead end. The cost to properly evaluate and rule it out (~half a day proving incompatibility) already exceeds the cost of implementing a native equivalent with maintained libraries (~1–2 days).
Recommendation: decline. The 6.81 opportunity score should be discounted — it reads as a generic "formatting is a common need" signal, not an assessment of this artifact. The decisive facts are 0 stars, 0 dependents, archived, and a framework mismatch with the stated stack. If the underlying requirement is real, satisfy it with league/commonmark + a purifier in Laravel, or with upstream Sonata in a legacy Symfony estate; do not adopt this fork in either case.
How can I help you explore Laravel packages today?