Skip to content

Instantly share code, notes, and snippets.

@kapv89
Forked from whisher/gist:5656791
Last active December 17, 2015 18:59
Show Gist options
  • Save kapv89/5656794 to your computer and use it in GitHub Desktop.
Save kapv89/5656794 to your computer and use it in GitHub Desktop.
<?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