Perform pattern based CSRF filter on all post, put, patch, and delete requests.

Submitted by Illusion - 10 years ago

Perform pattern based CSRF filter on all post, put, patch, and delete requests. Just add this code snippet at the top of routes.php

/*
|--------------------------------------------------------------------------
|       Pattern Based Filter
|--------------------------------------------------------------------------
*/
Route::when('*', 'csrf', array('POST', 'PUT', 'PATCH', 'DELETE'));