shevaua / laravel-seo
Seo tools for laravel blade templates
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/shevaua/laravel-seo
Requires
- php: ^7.0
 - laravel/framework: ^5.7
 
Requires (Dev)
- phpunit/phpunit: ^7
 
This package is auto-updated.
Last update: 2025-10-29 02:16:11 UTC
README
Installing
composer require shevaua/laravel-seo
Adding to layout:
<head>
    @seo
    ...
    <!-- other tags here -->
</head>
Setting Seo Information with Facade:
<?php
namespace App\Http\Controllers;
use SeoPage;
class TestSeoController extends Controller
{
    
    public function getTestSeoPage()
    {
        $title = 'Hello world!';
        $description = 'This is the test page';
        SeoPage::getInstance()
            ->setTitle($title);
        SeoPage::getInstance()
            ->setMeta('description', $description)
            ->setMeta('author', 'Igor Sheviakov')
            ->setOg('title', $title)
            ->setOg('description', $description);
        return view('test.seopage');
    }
}
Setting Seo Information with Injected object:
<?php
namespace App\Http\Controllers;
use Shevaua\LaravelSeo\SeoPage;
class TestSeoController extends Controller
{
    
    public function getTestSeoPage(SeoPage $page)
    {
        $title = 'Hello world!';
        $description = 'This is the test page';
        $page
            ->setTitle($title);
        $page
            ->setMeta('description', $description)
            ->setMeta('author', 'Igor Sheviakov')
            ->setOg('title', $title)
            ->setOg('description', $description);
        return view('test.seopage');
    }
}
References:
Using Facade:
SeoPage::getInstance() - method for getting singleton with seo information
Using instance:
SeoPage->setTitle(string $title) - setting title
SeoPage->setMeta(string $name, string $content) - setting meta
SeoPage->setOg(string $property, string $content) - setting meta with og prefix