Download the PHP package spescina/seorules without Composer
On this page you can find all versions of the php package spescina/seorules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package seorules
Seorules
A package for building seo rules in your Laravel projects. Manage with ease SEO meta tags (title, description, keywords, noindex) of your pages.
Installation
To install Seorules in Laravel 5.1, simply run composer require spescina\seorules
.
To install Seorules in Laravel 4, simply run composer require spescina\seorules 1.*
and then follow these instructions.
Once it's installed, you have to register the service provider. In app/config/app.php
add the following line of code to the providers
array
Spescina\Seorules\SeorulesServiceProvider::class
.
If you want in app/config/app.php
add the following line of code to the aliases
array
'Seo' => Spescina\Seorules\Facades\Seo::class
.
Register the route middleware adding these line to the app/Http/Kernel.php
file
'seorules.before' => \Spescina\Seorules\Init::class
.
Then, publish the config file with php artisan vendor:publish --provider="Spescina\Seorules\SeorulesServiceProvider" --tag="config"
.
Then, publish the migration file with php artisan vendor:publish --provider="Spescina\Seorules\SeorulesServiceProvider" --tag="migrations"
.
Then run the migration with php artisan migrate
.
Usage
Define your rules creating entries in the seorules database table
- alias: system identificative name of the rule
- route: name of the target route
- pattern: regular expression for matching page url (used for targeting different pages on the same route)
- priority: highest value come first
- title: title tag
- description: description meta tag
- keywords: keywords meta tag
- noindex: noindex meta tag
Attach seorules.before
middleware to your target named routes (route groups are reccomended)
Manage your rules in your controllers or in your closures
Display prepared fields in your views
Now you should have rendered this code when visiting /first
(assuming both routes are prepared with same placeholder data)
and when visting /second