为什么 laravel 5 csrf_token 值总是空的?
我如何获得该 token 值?
我试过了,
{!! csrf_token !!} , {{ csrf_token }} and
{{ Form::open() }} ....{{ Form::close() }}
我的输出
<input type="hidden" name="_token"></input>
最佳答案
这是因为您没有使用 web 组中间件。 Laravel 足够聪明,知道如果您不使用该组,则不需要 token 。
尝试在 Route::group(['middleware' => 'web']
... 中移动你的路线并告诉我们它:)
来源:不久前我犯了同样的错误。
关于php - laravel 5 csrf_token 值为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35216586/