Important
This project is old and not used anymore. Please use something like ash-jc-allen/short-url instead.
You can install the package with composer:
composer require mdooley47/laravel-redirect
The purpose of this package is to provide a default targetUrl
when redirecting in Laravel, if the current target does not match the desired url.
Simply call defaultTarget($options, $default)
on the Redirect Facade.
$options
either an array listing the robust validation options provided by mdooley47/laravel-urlvalidator or a string that will use the host
validator provided by mdooley47/laravel-urlvalidator.
\Illuminate\Support\Facades\Redirect::back()
->defaultTarget('match.domain.tld', 'default.domain.tld');
// Returns \Illuminate\Support\Facades\Redirect::getTargetUrl()