Laravel Head: Meta Tags, Open Graph &amp; JSON-LD | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD in Laravel 13        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)

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

 [  Laravel ](https://msaied.com/articles?category=laravel) [  Composer Pacakge ](https://msaied.com/articles?category=composer-pacakge)  #Laravel   #SEO   #Open Graph   #JSON-LD   #Meta Tags   #Laravel 13  

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

     4 Aug 2026      4 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   What Is Laravel Head?  ](#what-is-laravel-head)
2. [  02   Five-Layer Metadata Precedence  ](#five-layer-metadata-precedence)
3. [  03   Route-Level Metadata  ](#route-level-metadata)
4. [  04   Open Graph, Twitter Cards, and JSON-LD  ](#open-graph-twitter-cards-and-json-ld)
5. [  05   Rendering in Blade, Livewire, and Inertia  ](#rendering-in-blade-livewire-and-inertia)
6. [  06   Installation  ](#installation)
7. [  07   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)*

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Flaravel-head-manage-meta-tags-open-graph-and-json-ld-in-laravel-13&text=Laravel+Head%3A+Manage+Meta+Tags%2C+Open+Graph%2C+and+JSON-LD+in+Laravel+13) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Flaravel-head-manage-meta-tags-open-graph-and-json-ld-in-laravel-13) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  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`. 

      Q02  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. 

      Q03  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. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![Official Laravel Zed Extension: LSP Support for PHP and Blade Files](https://cdn.msaied.com/511/9a507c942d0051cc70a4c6769b27f734.png) Laravel Zed LSP 

### Official Laravel Zed Extension: LSP Support for PHP and Blade Files

The Laravel team has released an official Zed extension (v0.1.0) that wires Laravel LSP into the editor, bring...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 4 Aug 2026     3 min read  

  Read    

 ](https://msaied.com/articles/official-laravel-zed-extension-lsp-support-for-php-and-blade-files) [ ![PostgreSQL CTEs, Window Functions, and Lateral Joins in Laravel](https://cdn.msaied.com/506/7d5fcddaf6c26c87a749a20b8bdffbfa.png) laravel postgresql sql 

### PostgreSQL CTEs, Window Functions, and Lateral Joins in Laravel

Go beyond basic Eloquent queries. Learn how to leverage PostgreSQL CTEs, window functions, and LATERAL joins d...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 4 Aug 2026     1 min read  

  Read    

 ](https://msaied.com/articles/postgresql-ctes-window-functions-and-lateral-joins-in-laravel-4) [ ![Laravel Doctor: Diagnose Your Laravel App With One Artisan Command](https://cdn.msaied.com/513/2550bf2c87d0df242beb6ed7fe4df5d5.png) Laravel Artisan Health Checks 

### Laravel Doctor: Diagnose Your Laravel App With One Artisan Command

Laravel Doctor, announced at Laracon US 2026, adds an `artisan doctor` command that runs comprehensive health...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 3 Aug 2026     4 min read  

  Read    

 ](https://msaied.com/articles/laravel-doctor-diagnose-your-laravel-app-with-one-artisan-command-1) 

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

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
