If I have this line of code in my routes.php file:
Route::when('*', 'csrf', array('post', 'put', 'patch', 'delete'));
Do I still need to do this?
Route::group(array('before' => 'csrf'), function() {
Route::post('/search', array(
'as' => 'search-post',
'uses' => 'SearchController@postSearch'
));
});
Or is it ok to just do this?
Route::post('/search', array(
'as' => 'search-post',
'uses' => 'SearchController@postSearch'
));
input type="hidden" name="_token"field.