evgeniy-it/widget-bundle
Widget Bundle brings MODX-style shortcodes to your CMS, parsing nested [[widget? &option=value]] tags through a Twig filter. Includes simple template-based widgets, Doctrine repository widgets, array settings, and nesting.
First, a scope correction that itself is a PM decision: despite the brief labeling this a "Laravel/PHP package," evgeniy-it/widget-bundle is a Symfony bundle. If the product runs on Laravel, this package is not a candidate at all — it cannot be installed or bootstrapped without Symfony's bundle kernel. That single fact should kill it from a Laravel backlog in under five minutes.
Assuming a Symfony context, the package is a reference implementation of a content-authoring pattern, not a production dependency. It supports these decisions:
[[widget_name? &setting=value]] syntax (a ModX-snippet / WordPress-shortcode clone) lets editors embed dynamic fragments inside free-text body copy. This is a real fork in the road: shortcodes buy editor flexibility and cheap retrofitting into existing WYSIWYG fields; block editors buy structure, validation, and better authoring UX but require a content migration. Evaluating this package forces that decision to be made explicitly rather than by accident.SandboxExtension) into the security review — a decision worth surfacing early regardless of which library wins.Consider it (narrowly):
&settingArray=[1,2,3], `&settingAssocArray=`{'k':'v'}) and want a working example of that parsing grammar before writing your own.Adoption criteria to check before any commitment:
composer require to fail or require --ignore-platform-reqs, which is itself a red flag).Look elsewhere when:
template_from_string with a sandbox, over an abandoned 2017 bundle.thunderer/shortcode or webwizo/laravel-shortcodes, or Blade components; this bundle is inapplicable.To executives (one paragraph): The idea here is worth adopting; the package is not. It lets editors drop dynamic content — product cards, CTAs, pricing tables — directly into page copy without an engineering release, which is the kind of change that removes a recurring tax on the content team. But the artifact itself has one release from January 2017, zero known dependents, zero community, and no visible tests or security review, and it targets Symfony rather than our stack. Adopting it means owning a fork from day one. Recommendation: do not adopt; fund a short internal build using this repo as the specification. Estimated at two to three engineer-weeks, after which we own the code outright and the maintenance risk disappears.
To engineering: Treat this as a design document, not a dependency. The valuable parts to reuse conceptually are the argument grammar (&key=value``, plus JSON-ish array and associative-array arguments), recursive/nested widget resolution, a template-override mechanism, and a single Twig filter as the render entry point. The parts to discard are the code itself and its 2017 platform constraints. Non-negotiables in our version: explicit PHP/Symfony version support, unit tests around the parser (nesting, escaping, malformed input, backtick edge cases), output escaping by default, sandboxed template rendering, and a cache layer keyed on widget + arguments. Keep the grammar compatible with ModX/WordPress-style shortcodes so migrated content renders unchanged.
To the content/editorial team: You get a documented shortcode any editor can type, with a widget library and a preview path, instead of filing a ticket.
Success measures: number of content changes shipped without a deploy (target: near 100% of widget-level edits), time-to-first-widget for a new editor, count of distinct widgets reused across pages, and zero rendering regressions in the shortcode parser's test suite.
How can I help you explore Laravel packages today?