black-bits / laravel-seo-rewrite
A clean and easy to use package to create seo rewrites using events.
Requires
- php: ^7.1
- laravel/framework: ~5.2|~5.3|~5.4|~5.5|~5.6
Requires (Dev)
- larapack/dd: ^1.0
- orchestra/testbench: ~3.0
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-12-29 06:13:55 UTC
README
Introduction
With this package we want to give you a simple way to manage your SEO rewrites in your Laravel application. Rewrites are created and deleted by dispatching events in your code.
Installation
You can install the package via composer.
composer require black-bits/laravel-seo-rewrite
Next you need to run our migrations.
php artisan migrate
When you install the package our LaravelSeoRewrites Middleware is automatically pushed to the global MiddlewareGroup and activated.
Usage
To create a new redirect, simply create a new SeoRewrite entry.
- The source value must be a relative path matching one of your routes.
- The destination can be any relative or absolute URL.
- The type must be a valid redirect type (permanent, temporary, etc.)
SeoRewrite::create([ 'source' => '/old-route', 'destination' => '/new-route', 'type' => 301 ]); SeoRewrite::create([ 'source' => '/old-route', 'destination' => 'https://your-new.domain/old-route', 'type' => 308 ]);
We run a basic redirect loop detection on model save, but not all cases can be detected. Please be aware that you can potentially create loops.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security
If you discover any security related issues, please email hello@blackbits.io instead of using the issue tracker.
Credits
Support us
Black Bits, Inc. is a web and consulting agency specialized in Laravel and AWS based in Grants Pass, Oregon. You'll find an overview of what we do on our website.
License
The MIT License (MIT). Please see License File for more information.