Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SEO package made for maximum customization and flexibility

License

romanzipp/Laravel-SEO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Title

use romanzipp\Seo\Structs\Title;

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

... both compile to ...

<title>romanzipp</title>

Charset

use romanzipp\Seo\Structs\Meta\Charset;

seo()->add(new Charset);
use romanzipp\Seo\Structs\Meta\Charset;

seo()->add(Charset::make());
use romanzipp\Seo\Structs\Meta\Charset;

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

... all compile to ...

<meta charset="utf-8" />

Twitter

seo()->twitter('card', 'summary');
use romanzipp\Seo\Structs\Meta\Twitter;

seo()->add(Twitter::make()->name('card')->content('summary'));

... both compile to ...

<meta name="twitter:card" content="summary" />

Open Graph

seo()->twitter('site_name', 'romanzipp');
use romanzipp\Seo\Structs\Meta\OpenGraph;

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

... both compile to ...

<meta name="og:site_name" content="romanzipp" />

For more information see the Structs Documentation.

Render

{{ seo()->render() }}

Cheat Sheet

Code Rendered HTML
seo()->title('romanzipp') <title>romanzipp</title>
seo()->meta('author', 'romanzipp') <meta name="author" content="romanzipp" />
seo()->twitter('card', 'summary') <meta name="twitter:card" content="summary" />
seo()->og('site_name', 'romanzipp') <meta name="og:site_name" content="romanzipp" />
seo()->add(Charset::make()->charset('utf-8')) <meta charset="utf-8" />

Documentation

Documentation

Testing

./vendor/bin/phpunit

About

SEO package made for maximum customization and flexibility

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •