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

Client Templates Laravel Package

silber/client-templates

Laravel package for defining client-side templates with Blade, letting you reuse server-authored markup in browser-rendered interfaces. It helps keep JavaScript-driven UI templates consistent with your Laravel views without duplicating HTML.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. silber/client-templates is a small, single-purpose Laravel package: a service provider (and likely a published config file) that exposes a Blade directive for inlining client-side templates — Handlebars, Mustache, Underscore/Knockout, Alpine x-template, or raw <script type="text/x-template"> blocks — from separate files into a server-rendered view. Architecturally it sits entirely at the view composition layer: no models, no persistence, no HTTP surface, no background work. That makes it trivially composable with any Laravel app whose rendering strategy already depends on Blade, and irrelevant to apps that render templates client-side via a bundler (Vue SFCs, Svelte, React) or via API/JSON endpoints.

Integration feasibility. High in principle, low in confidence. The install path is the standard composer require + auto-discovery (or manual provider registration) + optional config publish, and the operational footprint is one directive. There is no middleware, queue, cache driver, or migration involved. The realistic integration cost is measured in hours, not sprints — provided the package loads at all on the target Laravel version.

Technical risk. This is the dominant concern and it is concentrated in one place: lifecycle. 13 stars and 0 dependents indicates essentially no production usage signal; the repo is almost certainly unmaintained and likely targets Laravel 5.x-era APIs (Blade directive registration, view.finder, possibly Illuminate\Support\Str helpers removed or changed since). Concrete risks:

  • Framework version drift. Blade's compiler, view finder, and service-provider auto-discovery have all changed materially since the Laravel 5/6 era. Compatibility with Laravel 9/10/11 is unverified and should be assumed broken until proven otherwise.
  • Blade cache semantics. If templates are inlined at compile time, editing a client template file will not invalidate the compiled Blade view, because Laravel keys compiled views on the top-level view's mtime. This is a silent correctness bug — stale templates in production after a partial deploy — and is the single most likely source of "it worked locally" incidents.
  • Path handling. Any directive that resolves a template name to a filesystem path is a path-traversal risk if the name is ever derived from user or database input. The safe usage is hard-coded literal names in Blade.
  • Abandonment/supply chain. An unmaintained package with a permissive license and a tiny code surface is best treated as source to vendor, not as a dependency to trust. The residual risk is not malicious, it is bit-rot.

Key questions to resolve before committing.

  1. What laravel/framework and php constraints does composer.json declare, and does composer require resolve cleanly on our target version?
  2. Is the directive evaluated at Blade compile time or at render time — and therefore, what is the cache-invalidation story when a template file changes?
  3. Is the template root configurable and confined, or does the directive accept arbitrary relative paths?
  4. Does it support partials/nesting (Handlebars {{> partial}} semantics), or only flat inlining?
  5. How does it behave under php artisan view:cache and view:clear in a deploy pipeline?
  6. What is the last commit date and the actual diff size? If the package is <150 LOC, the answer to every question above can be obtained by reading it in ten minutes — which is the correct next action.

Integration Approach

Stack fit. Good for: server-rendered Laravel apps that deliberately embed client templates (legacy Knockout/Backbone/Handlebars front ends, Alpine.js x-template patterns, progressively-enhanced pages that need templates available before the JS bundle parses). Poor for: Inertia/Vue/React SPAs, Livewire-heavy apps (Livewire owns the client-rendering story), and anything with a build step that can import .hbs directly. If the team's front-end already uses a bundler with a template loader, this package adds a second, divergent source of truth for templates and should be rejected on those grounds alone.

Migration path. Do not migrate to this package. Two realistic paths:

  • Greenfield/legacy adoption: vendor the code. Copy the service provider and directive into app/Support/ (or a first-party packages/ directory), retain the MIT header, register the directive in a service provider we own, and treat it as internal code. This eliminates the abandoned-dependency problem, makes the Blade-cache behavior ours to fix, and costs less than a procurement review of an unmaintained package.
  • Replace-in-place: the functionality is small enough to reimplement as a Blade component (<x-client-template name="..."/>) in well under a day, with explicit cache-busting via a template-file hash in the component's rendered output. This is the option I would recommend for any team on Laravel 9+.

Compatibility and sequencing. Verify in this order: (1) composer require resolves on the pinned Laravel version in a scratch branch; (2) the directive renders in a single non-critical view; (3) the template survives view:cache → edit template → view:cache in a staging pipeline, confirming invalidation behavior; (4) only then rollout to remaining views. Treat step 3 as a gate — if invalidation is broken, do not proceed to broader use without a workaround (template hash in the filename, or a deploy step that always clears views).

Operational Impact

Maintenance. Effectively zero upstream maintenance. No security patching, no Laravel-upgrade compatibility work, no issue triage. Every hour of maintenance is our hour. The good news is the blast radius is small and the code is likely short enough to fully audit; the bad news is that "small enough to audit" is also "small enough to own," which argues for vendoring.

Support. Community support is nil — no meaningful issue history at 13 stars, no Stack Overflow corpus, no dependents to compare notes with. Internal documentation must be written by whoever integrates it, particularly around the cache-invalidation behavior and the template directory convention.

Scaling. Runtime cost is negligible: a file read and string inclusion, once per Blade compilation if the directive is compile-time, and the compiled PHP output is served from OPcache like any other view. This will not be a bottleneck at any realistic scale. The scaling risk is organizational, not technical: template count and nesting depth grow, and with no partial-resolution or namespacing story the flat inlining approach becomes unwieldy past a few dozen templates.

Failure modes to plan for.

  • Stale templates in production — compiled Blade view outlives the edited template file. Mitigate with deploy-time view:clear or content-hashed template names.
  • Hard failure on missing file — a renamed template throws at render time, not deploy time. Add a smoke test or a build-time check that every referenced template exists.
  • Deploy ordering — if templates ship in the same artifact as compiled views, cache warmup must run after templates land.
  • Escaping/XSS — the package inlines template source, not data; safety depends entirely on the client-side renderer escaping interpolations correctly. Document that these templates are text/x-* script blocks, not HTML to be rendered server-side.
  • Path traversal — only if template names are ever dynamic; enforce literal names in code review.

Ramp-up. For a Laravel developer, near-zero: the concept is one directive and one directory. The genuine ramp-up burden is institutional — the team must absorb the knowledge that upstream is dead, that the cache behavior is subtle, and that fixes belong to us. Budget half a day for the integration spike plus a short ADR recording the vendor-vs-depend decision. Given the score (0.095), the star count, and the absence of dependents, the defensible TPM recommendation is: do not take a dependency; reimplement as a first-party Blade component with explicit cache invalidation, and only reconsider if the source review reveals functionality meaningfully richer than the description implies.

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.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
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