I have this code at the top of the routes file
Route::when('*', 'csrf', array('post', 'put', 'delete'));
When I test my RESTful API level, I get a token mismatch error. How to solve this?
I use CSRF protection for the regular submission of forms that the user can do. But how will this work for the API? I have API calls grouped after my regular routes as below
Route::group(array('prefix' => 'api'), function () {
Route::resource('shows', 'ShowsApiController');
Route::resource('episode', 'EpisodesApiController');
Route::resource('genre', 'GenresApiController');
});
source
share