Laravel CSRF protection with REST API
<p>I have this code at the top of my routes file </p>

<pre><code>Route::when('*', 'csrf', array('post', 'put', 'delete'));
</code></pre>

<p>When I testing my RESTful API layer I get token mismatch error. How to solve this? <br></p>

<p>I use CSRF protection for regular form submissions a user might do. But how would that work for an API? I have my API calls grouped after my regular routes as below</p>

<pre><code>Route::group(array('prefix' =&gt; 'api'), function () {
Route::resource('shows', 'ShowsApiController');
Route::resource('episode', 'EpisodesApiController');
Route::resource('genre', 'GenresApiController');
});
</code></pre>