Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

marzvrover/laravel-redirect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

This project is old and not used anymore. Please use something like ash-jc-allen/short-url instead.

laravel-redirect

Install

You can install the package with composer:

composer require mdooley47/laravel-redirect

How To Use

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages