PHPackages                             archtechx/laravel-seo - 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. archtechx/laravel-seo

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

archtechx/laravel-seo
=====================

v0.10.3(1y ago)324305.3k—1%33[6 PRs](https://github.com/archtechx/laravel-seo/pulls)3MITPHPPHP ^8.2CI passing

Since May 24Pushed 1y ago5 watchersCompare

[ Source](https://github.com/archtechx/laravel-seo)[ Packagist](https://packagist.org/packages/archtechx/laravel-seo)[ RSS](/packages/archtechx-laravel-seo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (29)Used By (3)

Laravel SEO
===========

[](#laravel-seo)

This is a simple and extensible package for improving SEO via meta tags, such as OpenGraph tags.

By default, it uses `` and OpenGraph tags. It also ships with a Twitter extension. You're, of course, free to write your own extensions as needed.

**Features**:

- Setting SEO tags from PHP
- Setting SEO tags from Blade
- Integration with [Flipp](https://useflipp.com) and [Previewify](https://previewify.app), to automatically generate cover images
- Custom extension support
- Expressive &amp; simple API
- Customizable views

Example usage:

```
seo()
    ->title($post->title)
    ->description($post->excerpt)
    ->twitter()
    ->flipp('blog')

// Adds OpenGraph tags
// Adds Twitter card tags
// Generates social image using Flipp and sets it as the cover photo
```

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

[](#installation)

```
composer require archtechx/laravel-seo
```

And add the following line to your layout file's `` tag:

```

```

Usage
-----

[](#usage)

The package can be used from any PHP code, or specifically from Blade using the `@seo` directive.

### PHP

[](#php)

Use the `seo()` helper to retrieve the SeoManager instance, on which you can call the following methods:

Available methods:

```
site(string $site)
url(string $url)
title(string $title)
description(string $description)
image(string $url)
type(string $type)
locale(string $locale)

twitterCreator(string $username)
twitterSite(string $username)
twitterTitle(string $title)
twitterDescription(string $description)
twitterImage(string $url)
```

Example usage:

```
seo()->title('foo')->description('bar')
```

### Blade views

[](#blade-views)

You can use the `@seo` directive to call the methods from Blade:

```
@seo('title') // Echoes the title
@seo('title', 'foo') // Sets the title & echoes it
@seo(['title' => 'foo']) // Sets the title without echoing it
```

In general, you'll want to use `@seo(['title' => 'foo'])` at the start of a view — to set the values — and `@seo('title')` inside the view if you wish to fetch the value.

That is, if you'll use the helpers in Blade at all. Some apps will only use the PHP helper.

For Twitter, use the `twitter.author` format, e.g. `@seo('twitter.author')`.

### Twitter

[](#twitter)

By default, no Twitter tags will be included. If you manually enable the extension by calling:

```
seo()->twitter();
```

in a service provider for example, the extension will be enabled.

Once it's enabled, it will copy all default (OpenGraph) values and use them for the Twitter card schema.

When a value is set specifically for Twitter, it will be prioritized over the general fallback values.

```
seo()->twitterTitle('About us')
```

### Favicons

[](#favicons)

By default, no favicon links will be included. You can manually enable the extension by calling:

```
seo()->favicon();
```

Generating favicons
-------------------

[](#generating-favicons)

To generate favicon, run:

```
php artisan seo:generate-favicons public/path-to/logo.png

```

from the artisan console. If no path argument is given we'll fallback to `public/assets/logo.png`.

We'll generate a 32x32px `public/favicon.ico` &amp; `public/favicon.png` icon. This should be sufficient for most cases.

**Please keep in mind that you need to install the [imagick](https://pecl.php.net/package/imagick) php extension and [intervention/image](http://image.intervention.io/) composer package.**

### Defaults

[](#defaults)

To configure default values, call the methods with the `default` argument:

```
seo()
    ->title(default: 'ArchTech — Meticulously architected web applications')
    ->description(default: 'We are a web development agency that ...');
```

### Extra tags

[](#extra-tags)

To add more tags to the document head, you can use the `tag()` and `rawTag()` methods:

```
seo()->tag('fb:image', asset('foo'));
seo()->rawTag('');
seo()->rawTag('fb_url', ''); // Keyed, allows overrides later on
```

### Canonical URL

[](#canonical-url)

To enable the `og:url` and canonical URL `link` tags, call:

```
seo()->withUrl();
```

This will make the package read from `request()->url()` (the current URL *without* the query string).

If you wish to change the URL, call `seo()->url()`:

```
seo()->url(route('products.show', $this->product));
```

### Locale

[](#locale)

To set the `og:locale` property:

```
seo()->locale('de_DE');
```

Expected format is `language_TERRITORY`.

### Modifiers

[](#modifiers)

You may want to modify certain values before they get inserted into the template. For example, you may want to suffix the meta `` with `| ArchTech` when it has a non-default value.

To do that, simply add the `modify` argument to the method calls like this:

```
seo()->title(modify: fn (string $title) => $title . ' | ArchTech');
```

You can, of course, combine these with the defaults:

```
seo()->title(
    default: 'ArchTech — Meticulously architected web applications',
    modify: fn (string $title) => $title . ' | ArchTech'
);
```

Which will make the package use the default if no title is provided, and if a title is provided using e.g. `seo()->title('Blog')`, it will be modified **right before being inserted into the template**.

### Flipp integration

[](#flipp-integration)

First, you need to add your Flipp API keys:

1. Add your API key to the `FLIPP_KEY` environment variable. You can get the key [here](https://useflipp.com/settings/profile/api).
2. Go to `config/services.php` and add: ```
    'flipp' => [
        'key' => env('FLIPP_KEY'),
    ],
    ```

Then, register your templates, for example in `AppServiceProvider`:

```
seo()->flipp('blog', 'v8ywdwho3bso');
seo()->flipp('page', 'egssigeabtm7');
```

After that, you can use the templates by calling `seo()->flipp()` like this:

```
seo()->flipp('blog', ['title' => 'Foo', 'content' => 'bar'])`
```

The call will set the generated image as the OpenGraph and Twitter card images. The generated URLs are signed.

If no data array is provided, the method will use the `title` and `description` from the current SEO config:

```
seo()->title($post->title);
seo()->description($post->excerpt);
seo()->flipp('blog');
```

The `flipp()` method also returns a signed URL to the image, which lets you use it in other places, such as blog cover images.

```

```

### Previewify integration

[](#previewify-integration)

First, you need to add your Previewify API keys:

1. Add your API key to the `PREVIEWIFY_KEY` environment variable. You can get the key [here](https://previewify.app/app/account).
2. Go to `config/services.php` and add: ```
    'previewify' => [
        'key' => env('PREVIEWIFY_KEY'),
    ],
    ```

Then, register your templates, for example in `AppServiceProvider`:

```
seo()->previewify('blog', 24);
seo()->previewify('page', 83);
```

After that, you can use the templates by calling `seo()->previewify()` like this:

```
seo()->previewify('blog', ['title' => 'Foo', 'content' => 'bar'])`
```

The call will set the generated image as the OpenGraph and Twitter card images. The generated URLs are signed.

If no data array is provided, the method will use the `title` and `description` from the current SEO config:

```
seo()->title($post->title);
seo()->description($post->excerpt);
seo()->previewify('blog');
```

The `previewify()` method also returns a signed URL to the image, which lets you use it in other places, such as blog cover images.

```

```

> **Note**The `previewify:` prefix will be automatically prepended to all provided data keys.

Examples
--------

[](#examples)

### Service Provider

[](#service-provider)

This example sets the default state in a service provider's `boot()` method:

```
seo()
    ->site('ArchTech — Meticulously architected web applications')
    ->title(
        default: 'ArchTech — Meticulously architected web applications',
        modify: fn (string $title) => $title . ' | ArchTech'
    )
    ->description(default: 'We are a development agency ...')
    ->image(default: fn () => asset('header.png'))
    ->flipp('blog', 'o1vhcg5npgfu')
    ->twitterSite('@archtechx');
```

### Controller

[](#controller)

This example configures SEO metadata from a controller.

```
public function show(Post $post)
{
    seo()
        ->title($post->title)
        ->description(Str::limit($post->content, 50))
        ->flipp('blog', ['title' => $page->title, 'content' => $page->excerpt]);

    return view('blog.show', compact($post));
}
```

### View

[](#view)

This example uses a Blade view that sets global SEO config using the values that are passed to the view.

```
@seo(['title' => $page->name])
@seo(['description' => $page->excerpt])
@seo(['flipp' => 'content'])

{{ $page->title }}
{{ $page->excerpt }}

    {{ $page->body }}

```

Customization
-------------

[](#customization)

This package is completely flexible, and can be customized either by having its views modified (to change the existing templates), or by you developing an extension (to add more templates).

### Views

[](#views)

You can publish the Blade views by running `php artisan vendor:publish --tag=seo-views`.

### Extensions

[](#extensions)

To use a custom extension, create a Blade *component* with the desired meta tags. The component should read data using `{{ seo()->get('foo') }}` or `@seo('foo')`.

For example:

```

```

Once your view is created, register the extension:

```
seo()->extension('facebook', view: 'my-component');
// The extension will use
```

To set data for an extension (in our case `facebook`), simply prefix calls with the extension name in camelCase, or use the `->set()` method:

```
seo()->facebookFoo('bar');
seo()->facebookTitle('About us');
seo()->set('facebook.description', 'We are a web development agency that ...');
seo(['facebook.description' => 'We are a web development agency that ...']);
```

To disable an extension, set the second argument in the `extension()` call to false:

```
seo()->extension('facebook', false);
```

Development
-----------

[](#development)

Run all checks locally:

```
./check
```

Code style will be automatically fixed by php-cs-fixer.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance44

Moderate activity, may be stable

Popularity55

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 72.4% 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

Every ~55 days

Recently: every ~161 days

Total

26

Last Release

438d ago

PHP version history (2 changes)v0.1.0PHP ^8.0

v0.10.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![stancl](https://avatars.githubusercontent.com/u/33033094?v=4)](https://github.com/stancl "stancl (55 commits)")[![Larsklopstra](https://avatars.githubusercontent.com/u/25669876?v=4)](https://github.com/Larsklopstra "Larsklopstra (4 commits)")[![entity](https://avatars.githubusercontent.com/u/47271716?v=4)](https://github.com/entity "entity (3 commits)")[![tpetry](https://avatars.githubusercontent.com/u/315686?v=4)](https://github.com/tpetry "tpetry (3 commits)")[![hofmannsven](https://avatars.githubusercontent.com/u/1214387?v=4)](https://github.com/hofmannsven "hofmannsven (2 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (2 commits)")[![tamas-macsek](https://avatars.githubusercontent.com/u/6494667?v=4)](https://github.com/tamas-macsek "tamas-macsek (1 commits)")[![l3aro](https://avatars.githubusercontent.com/u/25253808?v=4)](https://github.com/l3aro "l3aro (1 commits)")[![benbjurstrom](https://avatars.githubusercontent.com/u/12499093?v=4)](https://github.com/benbjurstrom "benbjurstrom (1 commits)")[![datlechin](https://avatars.githubusercontent.com/u/56961917?v=4)](https://github.com/datlechin "datlechin (1 commits)")[![dinhquochan](https://avatars.githubusercontent.com/u/9979458?v=4)](https://github.com/dinhquochan "dinhquochan (1 commits)")[![abrardev99](https://avatars.githubusercontent.com/u/54532330?v=4)](https://github.com/abrardev99 "abrardev99 (1 commits)")[![mralaminahamed](https://avatars.githubusercontent.com/u/34349365?v=4)](https://github.com/mralaminahamed "mralaminahamed (1 commits)")

---

Tags

laravelseo

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/archtechx-laravel-seo/health.svg)

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

###  Alternatives

[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k33.8M339](/packages/yajra-laravel-datatables-oracle)[cknow/laravel-money

Laravel Money

1.0k4.3M22](/packages/cknow-laravel-money)[livewire/flux

The official UI component library for Livewire.

9475.0M86](/packages/livewire-flux)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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