tehwave/laravel-shortcodes
tehwave/laravel-shortcodes brings WordPress-style shortcodes to Laravel Blade templates. Register custom shortcodes with attributes and enclosed content, then use them in any view to keep markup clean and reusable. A simple, lightweight way to add CMS-like content to your Blade views.
Architecture fit. tehwave/laravel-shortcodes is a content-templating utility: it registers shortcode handlers with the Laravel container and renders [tag]...[/tag] tokens embedded in stored content (CMS pages, emails, docs, marketing copy) into HTML or view output. Architecturally it is a thin, low-coupling package — a service provider, a registrar/parser, and Blade-friendly rendering. That makes it a low-risk fit for any Laravel app that needs authored content to carry dynamic fragments without a full page builder. It is not infrastructure, not a data layer, and not something the rest of the system will couple to.
Integration feasibility. High, with one gating condition. v3.0.0 raises the floor to Laravel 12 and supports Laravel 13, on PHP 8.2–8.5 (L12) and PHP 8.3–8.5 (L13). The upgrade surface is narrow — there are no API changes called out in the release notes, only the framework/PHP matrix change. The real work is therefore environmental, not code: confirm our running Laravel and PHP versions, and if we are on Laravel 11 or below, sequence our own framework upgrade first or stay pinned to 2.x.
Technical risk. Low-to-moderate, and almost entirely version-matrix risk rather than behaviour risk:
2.x branch, which will stop receiving fixes. This is a slow-burning security/maintenance exposure, not an immediate breakage.[tag] invokes a registered handler. The parser's handling of unknown tags, nested shortcodes, and escaping is not described in this release, so it must be validated before exposing shortcode authoring to non-privileged users.Key questions.
Stack fit. Fits the standard Laravel stack directly: install via Composer, register handlers in a service provider, render shortcode-bearing content in Blade or via a model accessor. No queue, cache, or external service dependency is implied. It slots in alongside existing content pipelines rather than replacing them.
Migration path. Treat this as a framework-first, package-second upgrade:
Compatibility. Confirm Composer resolution explicitly: laravel/framework ^12.0|^13.0 and php ^8.2 (L12) / ^8.3 (L13). Pin the constraint in composer.json (^3.0) and lock it, so an L11 application cannot accidentally resolve to 3.x. If any app must stay on L11, constrain it to ^2.0 deliberately and record that as accepted technical debt with a review date.
Sequencing. Framework upgrade → PHP runtime alignment (CI images, Dockerfile base, local tooling) → package install → handler implementation → content authoring → sanitisation review. Run the PHP/CI alignment before the framework bump to avoid a compound failure where it is unclear whether Laravel or the runtime broke the build.
Maintenance. Low ongoing effort. The package is small and stable; no migrations, no schema, no background jobs, no config sprawl. The meaningful maintenance obligation is tracking the upstream support matrix: the project's branch policy means our Laravel version dictates our package version, so framework upgrades now carry a package-upgrade decision with them. That coupling should be reflected in our upgrade runbook.
Support. Upstream is single-maintainer with a clear branch-per-framework convention (master for L12–L13, 2.x for L11, 1.x for L10 and below) — good hygiene, but thin bus factor. Mitigation: keep our handler set small and framework-agnostic (plain PHP callables returning strings/views) so that, if the package is abandoned, swapping in a local parser or a fork is a contained piece of work rather than a content rewrite.
Scaling. Negligible runtime cost — parsing and rendering are in-process string operations. The real scaling concern is cacheability: rendered shortcode output should be cached alongside the content (view cache, response cache, or a rendered-content column), otherwise dynamic fragments are re-resolved on every request. If shortcode output includes per-user data, that caching must be scoped or bypassed per user, and content must not be cached at a shared key.
Failure modes.
^3.0 — caught early by CI, but only if CI runs the lock install.Ramp-up. Very low for developers — a handler is a closure or invokable class plus a registration call; a mid-level Laravel developer is productive in under a day. The non-obvious learning is content governance: who may author shortcodes, which tags are permitted, and how rendered output is escaped. That is a written convention, not a training programme, and it is the single highest-value artefact to produce alongside the adoption. Budget roughly one sprint for framework upgrade plus package adoption on a single application, with content-authoring conventions as a parallel deliverable.
How can I help you explore Laravel packages today?