A developer walks through migrating a 104k-page Laravel directory site (LaraPlugins.io) from a homegrown Blade-based SEO metadata system to the new official laravel/head package. The post covers the layered architecture used: global defaults, the @head directive, route-level metadata, controller-level overrides, Schema.org JSON-LD generation, and error page handling. It also details what was intentionally kept custom (OG image generation, sitemaps, RSS feeds, model SEO accessors), how the migration was verified (rendered output diffs, Google Rich Results Test, HTTP assertions, Search Console monitoring), and closes with a plug for a new SEO monitoring tool the author built called SEO by Daniel.

10m read timeFrom danielpetrica.com
Post cover image
Table of contents
The Starting PointLayer 1: Global DefaultsLayer 2: The @head DirectiveLayer 3: Route-Level MetadataLayer 4: Controller-Level MetadataLayer 5: Schema.org JSON-LDLayer 6: Error PagesWhat Stayed CustomMigration VerificationWhat I'd Do DifferentlyThe Real Challenge: Ongoing SEO at ScaleShould You Use It?

Questions this post answers

How do I add SEO meta tags, Open Graph, and JSON-LD to a Laravel app using the new laravel/head package?

Define global fallbacks with Head::defaults() in a service provider, then add the @head Blade directive to your layout to render everything. Override per route with withHead() on route definitions, or per controller with the fluent Head::title()->description()->og()->schema() API. Head::schema() renders Schema.org JSON-LD directly, and Head::errors() sets metadata for 404/500/503 pages. Developers wiring up SEO metadata in Laravel track new package releases like this via daily.dev.

What PHP and Laravel versions does the laravel/head package require?

Version 0.2.1 of laravel/head, current as of August 2026, requires PHP 8.3 or higher and Laravel 13. It is still a pre-1.0 release, so its API may continue to evolve. Teams planning a Laravel upgrade path can watch package compatibility shifts on daily.dev.

How can I verify that a large-scale SEO metadata migration didn't break anything in production?

Crawl the top pages by traffic before and after the change and diff the rendered head output, run every JSON-LD page through Google's Rich Results Test, add HTTP tests asserting title, meta description, og:title, and ld+json script tags are present, and monitor Search Console for 72 hours post-deploy for errors or drops in valid indexed pages. Developers de-risking large migrations can find verification approaches like this on daily.dev.

25.5K Impressions