david-kurniawan / laraseo
Simple Laravel SEO Package
dev-master
2020-07-17 15:03 UTC
Requires
- php: ^5.6 || ^7.0
- illuminate/support: 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0
Requires (Dev)
- mockery/mockery: >=0.9.4
- orchestra/testbench: ^3.2
- phpunit/phpunit: ^5.7 || ^6.0 || ^7.0 || ^8.0
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2025-03-18 01:39:46 UTC
README
Just simple package for my daily activity.
Installation
Via Composer
$ composer require david-kurniawan/laraseo
Usage
In your Controller
use LaraSeo; use LaraOpenGraph; use LaraTwitterCard; // Meta LaraSeo::setTitle('Foo'); LaraSeo::setDescription('Foo bar'); LaraSeo::setLanguage('en-US'); LaraSeo::setAuthor(env('APP_NAME')); LaraSeo::setGenerator(url('/')); LaraSeo::setRegion('EN'); LaraSeo::setCanonical(url()->current()); LaraSeo::setHrefLang(url()->current()); // Opengraph LaraOpenGraph::setTitle('Foo'); LaraOpenGraph::setDescription('Foo bar'); LaraOpenGraph::setUrl(url()->current()); LaraOpenGraph::setSiteName(env('APP_NAME')); LaraOpenGraph::setType('website'); LaraOpenGraph::setImage('https://d1s5saizp11buw.cloudfront.net/airy-web/images/seo-landing-banner.jpg'); // Twitter Card LaraTwitterCard::setTitle('Foo'); LaraTwitterCard::setDescription('Foo bar'); LaraTwitterCard::setCard('summary'); LaraTwitterCard::setSite('@'.env('APP_NAME')); LaraTwitterCard::setCreator('@'.env('APP_NAME')); LaraTwitterCard::setImage('https://d1s5saizp11buw.cloudfront.net/airy-web/images/seo-landing-banner.jpg');
In your View
{!! LaraSeo::generate() !!} {!! LaraOpenGraph::generate() !!} {!! LaraTwitterCard::generate() !!}