Skip to content

Instantly share code, notes, and snippets.

@clouddueling
Created February 27, 2013 22:48
Show Gist options
  • Save clouddueling/5052586 to your computer and use it in GitHub Desktop.
Save clouddueling/5052586 to your computer and use it in GitHub Desktop.
username in url laravel
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');
});
@hasokeric
Copy link

Very neat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment