Add SEO capabilities to your website

v1.0.4 2021-06-30 15:10 UTC

This package is auto-updated.

Last update: 2021-09-30 15:45:33 UTC


Latest Version on Packagist Build Status Quality Score StyleCI Total Downloads

Adds ability to create custom titles / description on a per page basis. Includes usage of Twitter handles and Open Graph data for social sharing.


You can install the package via composer:

composer require gabrieliuga/laravel-seo-meta-box


artisan migrate

artisan vendor:publish --tag=metabox-config
* Manual entry
    'slug' => '/', //this is the page route 
    'title' => 'Super special application',
    'description' => 'My super special application that does x',
    'type' => 'page'

* Model based generator

use Giuga\LaravelSeoMetaBox\Traits\HasSeo;
use Giuga\LaravelSeoMetaBox\Traits\SeoOptions;
use Illuminate\Database\Eloquent\Model;

class Page extends Model
    use HasSeo;

    public function getSeoOptions(): SeoOptions
        return SeoOptions::create()
            ->setSlugField('slug') // optional
            ->setRoutePrefix('/page/') // optional
            ->setTitleField('name') // optional
            ->setDescriptionField('short_description') // optional
            ->setOverwriteOnUpdate(); // optional

Change your application layout to include @metabox blade component

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="" rel="stylesheet">
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">

The output will be (with all options enabled)

    <title>Super special application - Application Name</title>
    <meta name="description" content="My super special application that does x"/>
    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@g_iuga">
    <meta name="twitter:title" content="Super special application - Application Name">
    <meta name="twitter:description" content="My super special application that does x">
    <meta name="twitter:creator" content="@g_iuga">
    <meta property="og:title" content="Super special application - Application Name" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="" />
    <meta property="og:description" content="My super special application that does x" />
    <meta property="og:site_name" content="Application Name" />



View Customise

If you want to customize the output in any way, you can do so by publishing the view:

artisan vendor:publish --tag=metabox-views


Please see CHANGELOG for more information what has changed recently.


Please see CONTRIBUTING for details.


If you discover any security related issues, please email instead of using the issue tracker.



The MIT License (MIT). Please see License File for more information.