laravel/head
Laravel Head offers a fluent API for managing your app's document head—titles, meta tags, Open Graph, canonical URLs, robots directives, performance hints, and structured data. Works with Blade, Livewire, and Inertia.
Release delta (v0.2.2). One change: a first-class Event schema builder for JSON-LD structured data (PR #13, external contributor martinbean). No breaking changes, no deprecations, no configuration or API surface removed. This is an additive feature that narrows the "generic JSON-LD only" gap flagged in the prior assessment — the package now ships at least one opinionated, typed schema helper rather than leaving all structured data to hand-rolled arrays. It does not answer any of the open integration questions below, and it does not change the architectural verdict. The version number remains 0.2.x, which reinforces the pre-1.0 churn expectation.
Architecture fit. Laravel Head is a first-party (laravel/head) presentation-layer utility that centralizes document <head> construction behind a fluent API: title, meta, Open Graph, canonical, robots directives, performance hints (preload/prefetch), and JSON-LD structured data. Architecturally this is a low-coupling, additive package — it does not touch routing, persistence, or the domain layer, so it slots into an existing Laravel app without reshaping boundaries. The value proposition is consolidation: replacing ad-hoc @section('title'), @stack('meta'), and per-view <meta> literals with a single declarative source of truth that is testable and consistent across Blade, Livewire, and Inertia entry points. The v0.2.2 Event schema helper slightly deepens the coupling to the package: typed schema builders mean schema shape is now partly owned by laravel/head rather than by our own view code. That is a net positive for correctness and consistency, but it means schema markup changes become a dependency-upgrade concern, not purely a template concern.
Integration feasibility. Straightforward for a standard Laravel app: composer require laravel/head, define application-wide defaults (site name, default OG image, Twitter card type, canonical base), then set per-route/per-view values in controllers, middleware, or view components. The multi-renderer support (Blade, Livewire, Inertia) is the main differentiator versus single-paradigm alternatives, and it matters if the app mixes server-rendered marketing pages with an Inertia SPA shell. The new Event schema builder is directly usable if the product has any date-bearing content (webinars, launches, ticketing, scheduled releases) — it removes a small but real chunk of hand-written JSON-LD. If there is no event-like content in scope, the release is inert for us and can be taken at the next routine bump.
Technical risk.
<Head> component, Livewire's @push/navigate hooks, or a third-party SEO package (artesaos/seotools, ralphjsmit/laravel-seo, spatie/schema-org for JSON-LD). Precedence and deduplication behavior when both systems emit tags is the single most important thing to validate; duplicated or conflicting canonicals/OG tags are an SEO defect, not a cosmetic one.<script type="application/ld+json"> block.startDate timezone offsets, missing location or offers). Emitting a malformed Event schema is worse than emitting none: it can trigger Search Console errors and suppress rich results. Validation must be an explicit test step, not an assumption inherited from the library.wire:navigate or Inertia visits, head state must update on soft navigations, not just full page loads. Failure here manifests as stale titles/canonicals for crawlers that execute JS and for users.Key questions.
<Head> component and Livewire's wire:navigate — does it own head state end-to-end, or defer?schema-org still needed alongside?rel links, or is that out of scope?Stack fit. Best fit: Laravel 11/12 applications rendering through Blade or Livewire, with or without an Inertia front end. It is most valuable where multiple rendering paradigms coexist and head logic has already drifted. Weakest fit: SPAs where the front end owns the document head entirely, or legacy apps with a deeply entrenched SEO package whose admin UI is business-critical — the migration cost outweighs the benefit there. v0.2.2 marginally widens the fit: if the roadmap includes event-style content, the built-in builder is an argument for laravel/head over a general schema package for that slice. If structured data is broad and heterogeneous (products, reviews, FAQs, breadcrumbs), a dedicated schema library is still likely to sit alongside rather than be replaced.
Migration path. Treat this as a strangler-style consolidation, not a big-bang rewrite:
@section/@stack head blocks only after output parity is confirmed by tests.Compatibility. Verify against the actual pinned Laravel and PHP versions before committing. Check for coexistence with any existing SEO package — running both in parallel deliberately during migration is acceptable only if one is configured to emit nothing. Validate Inertia SSR if used: head tags must appear in the server-rendered HTML, not only after hydration, or crawlers and social scrapers see nothing. Treat v0.2.2 as a safe minor bump from v0.2.1 (additive, no removals) provided our own snapshot tests still pass — the risk is not regression in existing output but the temptation to adopt the new schema helper mid-migration.
Sequencing. Package evaluation spike (1–2 days) → output-parity test harness comparing legacy and new head markup for a representative page set → layout conversion → route-by-route conversion by traffic tier → structured-data conversion (legacy JSON-LD and/or new Event builder) → legacy removal. Gate the whole effort on the spike answering the precedence and escaping questions; if those are unresolved, do not proceed to layout conversion. Adopting the Event schema explicitly is a separate, lower-priority decision that should follow layout conversion, not lead it — schema is invisible to users and carries no rendering risk, but it does carry search-result risk if wrong.
Maintenance. Low ongoing cost. MIT license, first-party stewardship, changelog and tagged releases present, and the surface area is small — it emits markup and holds no state. Budget for periodic version bumps aligned to Laravel major releases, plus review of head output whenever templates change. One new maintenance obligation from v0.2.2: if the Event builder is adopted, event markup becomes dependency-owned, so schema shape changes on upgrade. Keep a snapshot test of emitted schema so a version bump that alters field names or ordering surfaces as a failing test rather than a silent Search Console warning.
Support. Documentation lives on the Laravel website, and support flows through the repository and Laravel's community channels — no commercial SLA unless covered by a Laravel support arrangement. Given 0 dependents, expect to be an early adopter: issues you hit may be unreported. That argues for pinning a known-good version and maintaining an internal note of deviations. The Event contributor is external, so coverage of edge cases (multi-day events, online-only events, timezone handling) should be treated as unproven until we test the specific shapes our content uses.
Scaling. Runtime cost is negligible — string assembly and rendering, no I/O. The scaling concerns are indirect: head resolution added to a hot render path should stay allocation-light, and if metadata is fetched from a database or CMS per request, that lookup belongs behind the existing cache layer rather than being introduced as a newly-per-request query. Event schema built from model data is one more argument for precomputing and caching the serialized schema blob alongside the page rather than assembling it per request.
Failure modes.
Ramp-up. Low for anyone already fluent in Laravel — the fluent API is idiomatic and the README-to-first-tag path is short. The real learning curve is organizational: agreeing a single metadata source of truth, defining defaults, and assigning ownership. v0.2.2 adds a small, contained technical learning item — whoever writes structured data must understand the Event schema's required fields and validation, which is a content-modeling skill rather than a Laravel skill. Estimate half a day per engineer for the API plus a short internal convention doc covering override rules and JSON-LD authoring standards, with a one-page addendum on event schema fields and the validation step.
Recommendation. Adopt conditionally — unchanged in direction, marginally strengthened in case. The package is a sensible consolidation of a genuinely messy cross-cutting concern and carries first-party credibility, but the adoption signal (123 stars, 0 dependents) means the risk is unproven behavior at the edges — precedence, soft navigation, escaping — not code quality. v0.2.2 is a benign, additive release that does not alter the decision and should not accelerate it; it is not a reason to bring structured-data work forward ahead of layout conversion. Run the short spike that answers the precedence, soft-navigation, and escaping questions with real markup diffs; proceed to migration only if it does. Track the schema API separately: if laravel/head grows typed builders for the schema types we actually need, it becomes a genuine replacement for a standalone schema package — until then, assume coexistence.
How can I help you explore Laravel packages today?