Laravel-SEO

Created: 2018-11-25 13:58
Updated: 2019-03-08 15:09
License: mit

README.md

Laravel SEO

Latest Stable Version Total Downloads License Code Quality Build Status

A SEO package made for maximum customization and flexibility.

Installation

composer require romanzipp/laravel-seo

Or add romanzipp/laravel-seo to your composer.json

"romanzipp/laravel-seo": "^1.0.0"

Run composer install to pull the latest version.

If you use Laravel 5.5+ you are already done, otherwise continue:

Add Service Provider to your app.php configuration file:

romanzipp\Seo\Providers\SeoServiceProvider::class,

Configuration

Copy configuration to config folder:

$ php artisan vendor:publish --provider="romanzipp\Seo\Providers\SeoServiceProvider"

Usage

Instantiation

use romanzipp\Seo\Facades\Seo;
use romanzipp\Seo\Services\SeoService;

class IndexController
{
    public function index(Request $request, SeoService $seo)
    {
        $seo = seo();

        $seo = app(SeoService::class);

        $seo = Seo::make();
    }
}

Examples

use romanzipp\Seo\Structs\Title;
use romanzipp\Seo\Structs\Meta\Charset;
use romanzipp\Seo\Structs\Meta\Twitter;
use romanzipp\Seo\Structs\Meta\OpenGraph;
// <title>romanzipp</title>

seo()->add(Title::make()->body('romanzipp'));

seo()->title('romanzipp');
// <meta charset="utf-8" />

seo()->add(Charset::make());

seo()->add(Charset::make()->charset('utf-8'));

seo()->add(new Charset);
// <meta name="twitter:card" content="summary" />

seo()->twitter('card', 'summary');

seo()->add(Twitter::make()->name('card')->content('summary'));
// <meta property="og:site_name" content="romanzipp" />

seo()->add(OpenGraph::make()->property('site_name')->content('romanzipp'));

seo()->og('site_name', 'romanzipp');

For more information see the Structs Documentation.

Render

seo()->render();

Documentation

Documentation

Testing

./vendor/bin/phpunit
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more