Laravel Head: Meta Tags, Open Graph &amp; JSON-LD | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. [Laravel](https://www.msaied.com/public/articles?category=laravel)
6. /
7. Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD in Laravel 13

   [Laravel](https://www.msaied.com/public/articles?category=laravel) [Composer Pacakge](https://www.msaied.com/public/articles?category=composer-pacakge) 

 Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD in Laravel 13
======================================================================

 Laravel Head is a new first-party package that gives you a fluent API for titles, meta descriptions, Open Graph tags, JSON-LD structured data, and resource hints — resolved per request across Blade, Livewire, and Inertia.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 4 Aug 2026 · Updated 5 Aug 2026 · 4 min read

ShareCopy linkCopied

 ![Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD in Laravel 13](https://cdn.msaied.com/512/4b4bedfc34f26b38c69fed3a3b5813e9.png) 

  On this page +1. [What Is Laravel Head?](#what-is-laravel-head)
2. [Five-Layer Metadata Precedence](#five-layer-metadata-precedence)
3. [Route-Level Metadata](#route-level-metadata)
4. [Open Graph, Twitter Cards, and JSON-LD](#open-graph-twitter-cards-and-json-ld)
5. [Rendering in Blade, Livewire, and Inertia](#rendering-in-blade-livewire-and-inertia)
6. [Installation](#installation)
7. [Key Takeaways](#key-takeaways)

 What Is Laravel Head?
---------------------

Laravel Head is a first-party package from the Laravel open-source team, introduced during Taylor Otwell's day-one keynote at Laracon US 2026. It provides a fluent API for everything that belongs in your HTML `` element: titles, meta descriptions, canonical URLs, Open Graph tags, robots directives, JSON-LD structured data, and resource hints. Metadata is resolved per request and works across Blade, Livewire, and Inertia applications.

Five-Layer Metadata Precedence
------------------------------

One of the package's core design decisions is a five-layer precedence system. From lowest to highest priority:

1. Page defaults
2. Route group metadata
3. Route metadata
4. Runtime metadata
5. Error metadata

Higher layers override lower layers one field at a time. A runtime title replaces a route title without affecting the route's description. Site-wide defaults are registered in a service provider:

```php
use Laravel\Head\Enums\OgType;
use Laravel\Head\Facades\Head;
use Laravel\Head\HeadBuilder;

Head::defaults(function (HeadBuilder $head) {
    $head
        ->title('Laravel', suffix: ' - Laravel')
        ->description('Build something great.')
        ->canonical()
        ->og(siteName: 'Laravel', type: OgType::Website)
        ->searchableByRobots()
        ->preconnect('https://fonts.example.com');
});

```

The suffix registered in defaults carries into higher layers automatically, so `Head::title('About')` renders `About - Laravel`.

Route-Level Metadata
--------------------

For pages with metadata known at definition time, `withHead()` attaches it directly to the route:

```php
Route::view('/contact', 'contact')
    ->name('contact')
    ->withHead(
        title: 'Contact Us',
        description: 'Get in touch.',
    );

```

It also works on route groups, resources, and singletons. Under the hood it writes plain arrays through Laravel's native route metadata API, so route caching remains fully compatible.

For data only available at request time, use the facade in your controller:

```php
public function show(Post $post)
{
    Head::title($post->title)
        ->description($post->description)
        ->when($post->isDraft(), fn ($head) => $head->hiddenFromRobots());

    return view('posts.show', ['post' => $post]);
}

```

Open Graph, Twitter Cards, and JSON-LD
--------------------------------------

Document `title` and `description` automatically fill in missing `og:title` and `og:description`. Register a Twitter card type in your defaults and the card tags are derived from the same values — no duplication required.

Structured data uses a separate `Schema` facade with nestable builders:

```php
use Laravel\Head\Enums\OfferAvailability;
use Laravel\Head\Facades\Schema;

Head::schema(
    Schema::product()
        ->name($product->name)
        ->offers(
            Schema::offer()
                ->price($product->price)
                ->currency('USD')
                ->availability(OfferAvailability::InStock)
        )
);

```

Built-in schema types include `article`, `blogPosting`, `product`, `offer`, `brand`, `breadcrumbs`, `faq`, `organization`, `person`, `webPage`, and `webSite`. Custom types can be registered with a `#[SchemaType]` attribute. Invalid JSON-LD throws an exception outside production and logs a warning in production.

Rendering in Blade, Livewire, and Inertia
-----------------------------------------

Blade and Livewire both use a single `@head` directive in the layout:

```blade

    @head

```

For Inertia, the package shares resolved head tags as an array of rendered element strings under a `head` prop on every page object, compatible with Inertia 3.5 and later. Each element carries a stable `data-inertia` key that Inertia keeps synchronized across visits and back/forward navigation. Because tags appear in the initial HTML response, crawlers and link-preview bots read them without executing JavaScript.

Installation
------------

Laravel Head requires PHP 8.3 and Laravel 13.17 or later:

```bash
composer require laravel/head

```

Register defaults in a service provider and add `@head` to your layout. Call `Head::toArray()` if you need the resolved metadata as a structured array rather than rendered markup.

Key Takeaways
-------------

- Five-layer precedence merges metadata field by field, so higher layers never accidentally wipe lower-layer values.
- `withHead()` on routes and groups is cache-compatible — no route caching workarounds needed.
- Open Graph, Twitter cards, and JSON-LD schemas share the same title and description source, reducing repetition.
- Inertia support requires no client-side `` component; tags are server-rendered and synchronized automatically.
- Invalid JSON-LD surfaces as an exception in development, keeping structured data errors visible early.
- Requires PHP 8.3 and Laravel 13.17+.

---

*Source: [Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD — Laravel News](https://laravel-news.com/laravel-head-package)*

- [Laravel](https://www.msaied.com/public/articles?search=Laravel)
- [SEO](https://www.msaied.com/public/articles?search=SEO)
- [Open Graph](https://www.msaied.com/public/articles?search=Open%20Graph)
- [JSON-LD](https://www.msaied.com/public/articles?search=JSON-LD)
- [Meta Tags](https://www.msaied.com/public/articles?search=Meta%20Tags)
- [Laravel 13](https://www.msaied.com/public/articles?search=Laravel%2013)

 Frequently asked questions 
---------------------------

  What are the minimum requirements for the Laravel Head package?Laravel Head requires PHP 8.3 and Laravel 13.17 or later. Install it via Composer with `composer require laravel/head`.

   Does Laravel Head work with Inertia.js, and does it require a client-side Head component?Yes. When Inertia is installed, the package shares resolved head tags as rendered element strings under a `head` prop on every page object, compatible with Inertia 3.5 and later. No client-side `&lt;Head&gt;` component is needed because tags are included in the initial HTML response and synchronized automatically across visits.

   How does the five-layer metadata precedence work in Laravel Head?Metadata is resolved from five layers in order: page defaults, route group metadata, route metadata, runtime metadata, and error metadata. Higher layers override lower layers one field at a time, so setting a runtime title replaces the route title without affecting the route's description or other fields.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com/public#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articlePostgreSQL CTEs, Window Functions, and Lateral Joins in Laravel](https://www.msaied.com/public/articles/postgresql-ctes-window-functions-and-lateral-joins-in-laravel-4) [Next articleOfficial Laravel Zed Extension: LSP Support for PHP and Blade Files](https://www.msaied.com/public/articles/official-laravel-zed-extension-lsp-support-for-php-and-blade-files)  

   On this page
-------------

1. [What Is Laravel Head?](#what-is-laravel-head)
2. [Five-Layer Metadata Precedence](#five-layer-metadata-precedence)
3. [Route-Level Metadata](#route-level-metadata)
4. [Open Graph, Twitter Cards, and JSON-LD](#open-graph-twitter-cards-and-json-ld)
5. [Rendering in Blade, Livewire, and Inertia](#rendering-in-blade-livewire-and-inertia)
6. [Installation](#installation)
7. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/740/cce86edc21eddcbdd2f2454fadaf9c70.png)  · 3 min read### The Pipeline Pattern in Laravel: Custom Pipelines Beyond Middleware

5 Oct 2026 ](https://www.msaied.com/public/articles/the-pipeline-pattern-in-laravel-custom-pipelines-beyond-middleware-1) [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://www.msaied.com/public/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://www.msaied.com/public/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
