Download the PHP package appstract/laravel-referer-redirector without Composer
On this page you can find all versions of the php package appstract/laravel-referer-redirector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download appstract/laravel-referer-redirector
More information about appstract/laravel-referer-redirector
Files in appstract/laravel-referer-redirector
Package laravel-referer-redirector
Short Description Manage redirects based on referers
License MIT
Homepage https://github.com/appstract/laravel-referer-redirect
Informations about the package laravel-referer-redirector
Laravel Referer Redirector
Manage redirects based on referers. You can add start and end dates so a referer can redirect to different url's in different time periods.
Installation
You can install the package via composer:
Publish
By running php artisan vendor:publish --provider="Appstract\RefererRedirector\RefererRedirectorServiceProvider" in your project all files for this package will be published. The file that will be published is a migration. A middleware will be registered.
Run the migration:
Usage
You need to add a middleware to handle the requests.
Add it to single routes:
Add it to route groups:
Or add it as global middleware:
Console
You can add a new redirect based on referer:
This will lead you through the needed steps.
Remove referer-redirect based on referer or ID:
List all referer-redirects:
Notes
If you're going to add referer-redirects manually to the database, keep the following in mind:
- referer_url: add without http://, https://, ending /
- redirect_url: the package will make a redirect(redirect_url), so make sure this url exists
- start_date: datetime (Carbon)
- end_date: datetime (Carbon)
Testing
Contributing
Contributions are welcome, thanks to y'all :)
About Appstract
Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on Medium. You can follow us on Twitter, buy us a beer or support us on Patreon.
License
The MIT License (MIT). Please see License File for more information.