PHPackages                             magutti/seo-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. magutti/seo-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

magutti/seo-tools
=================

SEO Tools for Laravel

V1.0(1mo ago)02↑2900%MITPHPPHP ^8.2

Since Mar 21Pushed 1mo agoCompare

[ Source](https://github.com/marcoax/maguttiSeoTools)[ Packagist](https://packagist.org/packages/magutti/seo-tools)[ GitHub Sponsors](https://github.com/feross)[ GitHub Sponsors](https://github.com/standard)[ RSS](/packages/magutti-seo-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (2)Used By (0)

maguttiSeoTools
===============

[](#maguttiseotools)

A comprehensive SEO package for Laravel 12/13 that manages meta tags, Open Graph, Twitter Cards, and JSON-LD structured data from a single unified interface.

Features
--------

[](#features)

- **Meta Tags** — title, description, keywords, canonical, robots, hreflang, pagination, webmaster verification
- **Open Graph** — full OG support including articles, videos, music, books, products, and profiles
- **Twitter Cards** — summary, large image, app, and player card types
- **JSON-LD** — Schema.org structured data, single or multiple blocks per page
- **Inertia.js integration** — reactive meta tags for Vue/React frontends
- **Synchronized updates** — setting a title once propagates across all formats

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel 12 or 13

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

[](#installation)

```
composer require magutti/seo-tools
```

The service provider and facades are auto-discovered by Laravel.

Publish the configuration file:

```
php artisan vendor:publish --provider="Magutti\SeoTools\Providers\SeoToolsServiceProvider"
```

Configuration
-------------

[](#configuration)

`config/seotools.php` controls defaults for all managers:

```
return [
    'inertia' => false,  // set to true to enable Inertia.js support
    'meta' => [
        'defaults' => [
            'title'       => false,
            'titleBefore' => false,
            'description' => false,
            'separator'   => ' - ',
            'keywords'    => [],
            'canonical'   => false,
            'robots'      => false,
        ],
        'webmaster_tags' => [
            // 'google'    => 'your-code',
            // 'bing'      => 'your-code',
            // 'alexa'     => 'your-code',
            // 'pinterest' => 'your-code',
            // 'yandex'    => 'your-code',
            // 'norton'    => 'your-code',
        ],
    ],
    'opengraph' => [
        'defaults' => [
            'title'       => false,
            'description' => false,
            'url'         => false,
            'type'        => false,
            'site_name'   => false,
            'images'      => [],
        ],
    ],
    'twitter'  => ['defaults' => []],
    'json-ld'  => [
        'defaults' => [
            'title'       => false,
            'description' => false,
            'url'         => false,
            'type'        => 'WebPage',
            'images'      => [],
        ],
    ],
];
```

Basic Usage
-----------

[](#basic-usage)

### In a controller

[](#in-a-controller)

```
use Magutti\SeoTools\Facades\SEOTools as SEO;

class ArticleController extends Controller
{
    public function show(Article $article)
    {
        SEO::setTitle($article->title)
           ->setDescription($article->excerpt)
           ->setCanonical(route('articles.show', $article))
           ->addImages([$article->cover_url]);

        return view('articles.show', compact('article'));
    }
}
```

### In a Blade view

[](#in-a-blade-view)

```

    {!! SEO::generate() !!}

```

Pass `true` to minify the output:

```
{!! SEO::generate(true) !!}
```

### Using the trait

[](#using-the-trait)

```
use Magutti\SeoTools\Traits\SEOTools;

class PostController extends Controller
{
    use SEOTools;

    public function show(Post $post)
    {
        $this->seo()->setTitle($post->title);
    }
}
```

Facades
-------

[](#facades)

FacadeAliasClass`SEOTools``SEO``Magutti\SeoTools\Facades\SEOTools``SEOMeta``SEOMeta``Magutti\SeoTools\Facades\SEOMeta``OpenGraph``OpenGraph``Magutti\SeoTools\Facades\OpenGraph``TwitterCard``Twitter``Magutti\SeoTools\Facades\TwitterCard``JsonLd``JsonLd``Magutti\SeoTools\Facades\JsonLd``JsonLdMulti`—`Magutti\SeoTools\Facades\JsonLdMulti`SEOMeta
-------

[](#seometa)

```
use Magutti\SeoTools\Facades\SEOMeta;

SEOMeta::setTitle('Page Title')
       ->setDescription('Page description')
       ->setKeywords(['laravel', 'seo'])
       ->setCanonical('https://example.com/page')
       ->setRobots('index,follow')
       ->addAlternateLanguage('it', 'https://example.com/it/page')
       ->setPrev('https://example.com/page/1')
       ->setNext('https://example.com/page/3');
```

Open Graph
----------

[](#open-graph)

```
use Magutti\SeoTools\Facades\OpenGraph;

OpenGraph::setTitle('Page Title')
         ->setDescription('Page description')
         ->setUrl('https://example.com/page')
         ->setType('article')
         ->setSiteName('My Site')
         ->addImage('https://example.com/image.jpg');

// Article-specific properties
OpenGraph::setArticle([
    'published_time' => '2024-01-01',
    'author'         => 'Marco Asperti',
    'section'        => 'Technology',
    'tags'           => ['laravel', 'seo'],
]);
```

Supported OG types with dedicated setters: `article`, `profile`, `book`, `music.song`, `music.album`, `video.movie`, `video.episode`, `video.tv_show`, `product`.

Twitter Cards
-------------

[](#twitter-cards)

```
use Magutti\SeoTools\Facades\TwitterCard;

TwitterCard::setType('summary_large_image')
           ->setSite('@mysitehandle')
           ->setTitle('Page Title')
           ->setDescription('Page description')
           ->setImage('https://example.com/image.jpg');
```

JSON-LD
-------

[](#json-ld)

### Single block

[](#single-block)

```
use Magutti\SeoTools\Facades\JsonLd;

JsonLd::setType('Article')
      ->setTitle('Article Title')
      ->setDescription('Article description')
      ->setUrl('https://example.com/article')
      ->addImage('https://example.com/image.jpg')
      ->addValue('author', ['@type' => 'Person', 'name' => 'Marco Asperti'])
      ->addValue('datePublished', '2024-01-01');
```

### Multiple blocks

[](#multiple-blocks)

```
use Magutti\SeoTools\Facades\JsonLdMulti;

// First block (index 0 is created automatically)
JsonLdMulti::setType('Article')->setTitle('Article Title');

// Add a second block
JsonLdMulti::newJsonLd()
           ->setType('BreadcrumbList')
           ->addValue('itemListElement', [/* breadcrumb items */]);

// Switch between blocks
JsonLdMulti::select(0)->setDescription('Updated description');
```

SEOFriendly Interface
---------------------

[](#seofriendly-interface)

Implement `Magutti\SeoTools\Contracts\SEOFriendly` on your models to allow controllers to load SEO data in a standardized way:

```
use Magutti\SeoTools\Contracts\SEOFriendly;
use Magutti\SeoTools\Contracts\MetaTags;
use Magutti\SeoTools\Contracts\OpenGraph;
use Magutti\SeoTools\Contracts\TwitterCards;
use Magutti\SeoTools\Contracts\JsonLd;

class Article extends Model implements SEOFriendly
{
    public function loadSEO(MetaTags $meta, OpenGraph $og, TwitterCards $twitter, JsonLd $jsonLd): void
    {
        $meta->setTitle($this->title)->setDescription($this->excerpt);
        $og->setTitle($this->title)->addImage($this->cover_url);
        $twitter->setTitle($this->title)->setImage($this->cover_url);
        $jsonLd->setType('Article')->setTitle($this->title);
    }
}
```

Then in your controller:

```
use Magutti\SeoTools\Traits\SEOTools;

class ArticleController extends Controller
{
    use SEOTools;

    public function show(Article $article)
    {
        $this->loadSEO($article);
        return view('articles.show', compact('article'));
    }
}
```

Inertia.js Support
------------------

[](#inertiajs-support)

Set `'inertia' => true` in `config/seotools.php` (or `SEO_TOOLS_INERTIA=true` in `.env`). Generated tags will include the `inertia` attribute, making them reactive in Vue/React components via `@inertiajs/vue3` or `@inertiajs/react`.

License
-------

[](#license)

MIT — see [LICENSE.md](LICENSE.md).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/badc07fb1a88defc9bf39b3dc1faa88e5ae00f1752e5be503c7df95cce3bf3cd?d=identicon)[marcoax](/maintainers/marcoax)

---

Top Contributors

[![marcoax](https://avatars.githubusercontent.com/u/6276864?v=4)](https://github.com/marcoax "marcoax (4 commits)")

---

Tags

laravelJSON-LDseometatagsopengraphseotools

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/magutti-seo-tools/health.svg)

```
[![Health](https://phpackages.com/badges/magutti-seo-tools/health.svg)](https://phpackages.com/packages/magutti-seo-tools)
```

###  Alternatives

[artesaos/seotools

SEO Tools for Laravel and Lumen

3.3k5.1M60](/packages/artesaos-seotools)[butschster/meta-tags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project

628730.7k2](/packages/butschster-meta-tags)[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.1M30](/packages/prologue-alerts)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[honeystone/laravel-seo

SEO metadata and JSON-LD package for Laravel.

34744.1k](/packages/honeystone-laravel-seo)[arcanedev/seo-helper

SEO Helper is a framework agnostic package that provides tools &amp; helpers for SEO (Laravel supported).

332467.0k4](/packages/arcanedev-seo-helper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
