filters.php 885 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<?php

return array(

	/*
	|--------------------------------------------------------------------------
	| Filters
	|--------------------------------------------------------------------------
	|
	| Filters provide a convenient method for filtering access to your route
	| functions. To make your life easier, we have already setup basic filters
	| for authentication and CSRF protection.
	|
	| For more information, check out: http://laravel.com/docs/basics/routes#filters
	|
	*/

	'before' => function()
	{
		// Do stuff before every request is executed.	
	},


	'after' => function($response)
	{
		// Do stuff after every request is executed.
	},


	'auth' => function()
	{
		return ( ! Auth::check()) ? Redirect::to_login() : null;
	},


	'csrf' => function()
	{
38
		return (Input::get('csrf_token') !== Form::raw_token()) ? Response::make(View::make('error/500'), 500) : null;
39 40 41
	},

);