PHPackages                             spescina/seorules - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. spescina/seorules

ActiveLibrary[Database &amp; ORM](/categories/database)

spescina/seorules
=================

A tool for building seo rules in your Laravel projects

2.0.3(9y ago)116281[1 issues](https://github.com/spescina/seorules/issues)MITPHP

Since Aug 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/spescina/seorules)[ Packagist](https://packagist.org/packages/spescina/seorules)[ RSS](/packages/spescina-seorules/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (1)Versions (21)Used By (0)

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
------------

[](#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](https://github.com/spescina/seorules/blob/v1/README.md) 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
-----

[](#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

```
{
  alias: 'first',
  route: 'first.route',
  pattern: '',
  priority: 0,
  title: 'the first route title is [#_first_placeholder]',
  description: 'my first route description is [#_second_placeholder]',
  keywords: '[#_first_placeholder], [#_second_placeholder], laravel',
  noindex: 0
},
{
  alias: 'second',
  route: 'second.route',
  pattern: '',
  priority: 0,
  title: 'the second route title is [#_second_placeholder]',
  description: 'my second route description is empty',
  keywords: '[#_first_placeholder]',
  noindex: 1
}
```

Attach `seorules.before` middleware to your target named routes (route groups are reccomended)

```
Route::group(['middleware' => 'seorules.before'], function()
{
    Route::get('/first', array('as' => 'first.route', function(){
        //do things
    }));

    Route::get('/second', array('as' => 'second.route', function(){
        //do things
    }));
});
```

Manage your rules in your controllers or in your closures

```
Seo::addPlaceholder('first_placeholder','Foo');
Seo::addPlaceholder('second_placeholder','Bar');
```

Display prepared fields in your views

```
{{ Seo::get('title') }}

@if (Seo::get('noindex'))

@endif
```

Now you should have rendered this code when visiting `/first` (assuming both routes are prepared with same placeholder data)

```
the first route title is Foo

```

and when visting `/second`

```
the second route title is Bar

```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Recently: every ~118 days

Total

19

Last Release

3457d ago

Major Versions

v1.3.2 → 2.0.02015-09-15

1.x-dev → 2.0.12015-09-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/1da812cfabeba8d2a2a658ffa61204f0e5ccbb70dc3b81fc6cebf0eb28f8f73f?d=identicon)[simonpex](/maintainers/simonpex)

---

Top Contributors

[![spescina](https://avatars.githubusercontent.com/u/1956604?v=4)](https://github.com/spescina "spescina (33 commits)")

---

Tags

laravelpagedatabaseseo

### Embed Badge

![Health badge](/badges/spescina-seorules/health.svg)

```
[![Health](https://phpackages.com/badges/spescina-seorules/health.svg)](https://phpackages.com/packages/spescina-seorules)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.1M11.2k](/packages/illuminate-database)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.0M88](/packages/mongodb-laravel-mongodb)[kreait/laravel-firebase

A Laravel package for the Firebase PHP Admin SDK

1.3k18.0M46](/packages/kreait-laravel-firebase)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591452.8k2](/packages/spiritix-lada-cache)[vectorial1024/laravel-cache-evict

Efficiently remove expired Laravel file/database cache data

5916.2k](/packages/vectorial1024-laravel-cache-evict)[itpathsolutions/dbstan

Database Standardization and Analysis Tool for Laravel

442.1k](/packages/itpathsolutions-dbstan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
