have you un-commented the middleware in the bootstrap/app.php file?
Apr 23, 2015
7
Level 1
Lumen CSRF Token Mismatch
I am trying to resolve this issue with CSRF setup, here is what i have did...
csrf token in HTML
<input type="hidden" name="_token" value="{{ csrf_token() }}">
Routes.php
$app->post('/fetch', [
'middleware' => 'csrf',
'as' => 'fetchInfo', 'uses' => 'App\Http\Controllers\AppController@fetchInfo'
]);
I am getting following error when form gets submitted...
ErrorException in Application.php line 1267: Undefined index: csrf
Can you please help me to resolve this issue, thanks
Level 1
This problem got fixed by adding following in app.php...
$app->routeMiddleware([
'csrf' => 'Laravel\Lumen\Http\Middleware\VerifyCsrfToken'
]);
@JeffreyWay Can you please suggest,why didn't lumen added this at first place?
Thanks
1 like
Please or to participate in this conversation.