Last active
August 29, 2015 14:05
-
-
Save vluzrmos/ec4fbd7d690c5437d6b8 to your computer and use it in GitHub Desktop.
Laravel Helper para redirecionar o usuário devolta para a última página ou para um lugar default.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function redirect_back_or_default($url = null){ | |
try{ | |
return Redirect::back(); | |
}catch(Exception $e){ | |
return Redirect::to($url); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment