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

Laravel Shortcodes Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • Laravel 11 is now unsupported upstream. Any service still on L11 must remain on the 2.x branch, which will stop receiving fixes. This is a slow-burning security/maintenance exposure, not an immediate breakage.
  • PHP 8.3 minimum on Laravel 13. If we track L13, any CI image, container base, or developer machine on PHP 8.2 becomes a blocker. The PHP 8.2–8.5 window on L12 is wider, so L12 is the safer landing zone in the near term.
  • Rendering semantics for user-authored content. Shortcodes are an injection surface: a stored [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.
  • Abandonment risk. A single-maintainer package is a real consideration for content that is expensive to re-author. The 3.x/L12–L13, 2.x/L11, 1.x/L10-and-below branch structure is a healthy sign of active maintenance, but it also means content with embedded shortcodes is a migration liability if the package stalls.

Key questions.

  1. What Laravel and PHP versions are our candidate applications on today, and is there a committed L12+ path and date?
  2. Where would shortcodes appear — trusted editorial content, or end-user input? This determines whether we need a sanitisation layer around rendered output.
  3. What is the behaviour for unregistered or malformed tags (silent strip, raw passthrough, exception)? This drives our error-handling and content-validation design.
  4. Does the parser support nesting and self-closing tags, and are there documented limits on recursion or payload size?
  5. Is the package's test suite and release cadence sufficient for our support policy, and do we need a maintained fork contingency?
  6. Does dropping L11 align with our own framework support policy, or does it force an upgrade earlier than planned?

Integration Approach

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:

  1. Inventory. Establish the Laravel/PHP version of every app that would consume the package, and whether shortcodes exist in stored content today.
  2. Upgrade the framework. Move the target app to Laravel 12 (recommended first landing — widest PHP window at 8.2–8.5, and the lowest-risk step off L11) before touching the package. Laravel 13 only once PHP 8.3+ is standardised across CI, containers, and dev environments.
  3. Then install v3.0.0. Because no code-level breaking changes are documented beyond the version constraint, expect the package upgrade itself to be uneventful — any failure is more likely to be our framework upgrade surfacing than the package.
  4. Content backfill. If we are introducing shortcodes for the first time, author a small set of handlers and a content-style guide rather than retrofitting arbitrary existing content.

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.

Operational Impact

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.

  • Version drift: an app left on 2.x/L11 stops receiving security fixes — silent, cumulative risk.
  • Rendering exceptions: a handler that throws (missing record, external API down) breaks the whole page render rather than degrading gracefully. Handlers should be written defensively and return safe fallbacks.
  • Injection: user-supplied shortcode syntax reaching a privileged handler is an escalation path; restrict authoring to trusted roles and escape handler output.
  • Silent content corruption: if a tag becomes unregistered, content may render with raw markup visible or with content stripped — validate output in staging against a sample of real content before release.
  • Composer resolution failure on L11 apps attempting ^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.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource