我安装了一个新的laravel 5.8。在那之后我运行:
php artisan make:auth
一切看起来都很好,但是当我尝试登录(例如:用不正确的值填写表单)时,我收到了"TokenMismatchException in VerifyCsrfToken.php Line68“错误。
我在每个身份验证表单中都得到了这些异常!
我的视图(登录):
<form class="form-horizontal" method="POST" action="{{ route('login') }}">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password" required>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<div class="checkbox">
<label>
<input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Login
</button>
<a class="btn btn-link" href="{{ route('password.request') }}">
Forgot Your Password?
</a>
</div>
</div>
</form>
我不知道是怎么回事,但是拉威尔在工匠命令后自己崩溃了。
从{{csrf_field()}}更改为{!!csrf_field() !!}已尝试。不能工作。
发布于 2019-04-17 19:09:49
我在plesk上运行我的laravel。为了解决这个问题,我刚刚将存储权限和子文件夹权限更改为777,并使用nginx将版本从php 7.2更新到php 7.2。
https://stackoverflow.com/questions/55713698
复制相似问题