Route Groups CSRF

Submitted by ironheartbj18 - 9 years ago

about using the CSRF filter in your forms. Often you will want to apply a filter to many routes. Instead of attaching the filter to each individual route, you can assign it to many routes at the same time as a group:

Route::group(array('before' => 'csrf'), function()
{
  Route::post('/user', function()
  {
 
  });
 
  Route::post('post', function()
  {
 
  });
});

In this example I’m protecting many routes against CSRF attacks
(What is a CSRF attack? look up Google) using a filter and a group.