Skip to content

Instantly share code, notes, and snippets.

@whisher
Created May 27, 2013 12:21
Show Gist options
  • Save whisher/5656791 to your computer and use it in GitHub Desktop.
Save whisher/5656791 to your computer and use it in GitHub Desktop.
<?php
Route::get('/', function()
{
return View::make('home.index');
});
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