-
-
Save kapv89/5656794 to your computer and use it in GitHub Desktop.
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 | |
Route::get('/', function() | |
{ | |
return View::make('home.index'); | |
}); | |
Route::controller('home'); | |
Event::listen('404', function() | |
{ | |
return Response::error('404'); | |
}); | |
Event::listen('500', function($exception) | |
{ | |
return Response::error('500'); | |
}); | |
Route::filter('before', function() | |
{ | |
// Do stuff before every request to your application... | |
}); | |
Route::filter('after', function($response) | |
{ | |
// Do stuff after every request to your application... | |
}); | |
Route::filter('csrf', function() | |
{ | |
if (Request::forged()) return Response::error('500'); | |
}); | |
Route::filter('auth', function() | |
{ | |
if (Auth::guest()) return Redirect::to('login'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment