lodeb / laravel-seo
SEO package for Laravel
Fund package maintenance!
lodeb
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/lodeb/laravel-seo
Requires
- php: ^8.3
- illuminate/contracts: ^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
README
Installation
You can install the package via composer:
composer require lodeb/laravel-seo
You can publish the config file with:
php artisan vendor:publish --tag="seo-config"
This is the contents of the published config file:
return [ 'default_title' => 'My Awesome Website', 'default_description' => 'This is the best website ever built with Laravel SEO package.', 'default_keywords' => ['laravel', 'seo', 'package', 'awesome'], 'default_author' => 'Your Name', 'default_robots' => 'index, follow', 'set_canonical_url' => true, 'set_og_tags' => true, 'set_twitter_cards' => true, ];
Usage
There is a singelton SEO Class. Set the SEO tags you want to generate.
\Lodeb\SEO\Facades\SEO::setTitle($this->meta_title); \Lodeb\SEO\Facades\SEO::setDescription($this->meta_description); \Lodeb\SEO\Facades\SEO::setKeywords(explode(',', $this->meta_keywords)); \Lodeb\SEO\Facades\SEO::setAuthor($this->meta_author); \Lodeb\SEO\Facades\SEO::setRobots($this->meta_robots);
// App.blade
{!! \Lodeb\SEO\Facades\SEO::generate() !!}
Credits
License
The MIT License (MIT). Please see License File for more information.