This package provides simple functionality to manage SEO tags based on URL path within your Laravel application.
You can put the URL path available within your app with the JSON of tags you want to get in the view under the specified path. The wildcard *
notation is available as well. You will get the manager variable with tags for each view as a Collection
instance by default. The model to use by the package and variable name is customizable in the config file.
The package requires PHP ^8.x
and Laravel ^8.71
or ^9.0
.
Install the package using composer:
composer require michael-rubel/laravel-seo-manager
Publish the migration:
php artisan vendor:publish --tag="seo-manager-migrations"
Publish the config file:
php artisan vendor:publish --tag="seo-manager-config"
After publishing the config and running migrations, you can apply URLs in the seo_tags
table using following patterns:
/test-url/*
/test-url/my-target
/test-url/any-target/*
Wildcard *
has a lower priority than explicit define.
- Note: If you're going to override the model to use a different database structure, make sure your model implements SeoTagContract. The package uses two simple methods to get the database columns.
If you see the way we can improve the package, you're free to open an issue or pull request.
composer test