Created
February 27, 2013 22:48
-
-
Save clouddueling/5052586 to your computer and use it in GitHub Desktop.
username in url laravel
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
Event::listen('404', function() | |
{ | |
$username = URI::segment(1); | |
$user = User::where_username($username) | |
->where_type('account') | |
->first(); | |
if ($user != null) { | |
if ($user->username != '') { | |
return Controller::call('website@view', array($user->id)); | |
} | |
} | |
return Response::error('404'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very neat