我使用 make:auth 创建注册和登录控制器,然后正确编辑表单和验证;
<form method="POST" action="{{ route('register') }}">
@csrf
<div class="form-group row">
<label for="firstname" class="col-md-4 col-form-label text-md-right">{{ __('First Name') }}</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control @error('firstname') is-invalid @enderror" name="firstname" value="{{ old('firstname') }}" required autocomplete="firstname" autofocus>
@error('firstname')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="surname" class="col-md-4 col-form-label text-md-right">{{ __('Surname') }}</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control @error('surname') is-invalid @enderror" name="surname" value="{{ old('surname') }}" required autocomplete="surname" autofocus>
@error('surname')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
我还正确编辑了注册控制器和 user.php,但是当我单击提交按钮时,我的表单验证正确但不保存或将我重定向到下面的主刀片是注册控制器;
呼啦一阵风
www说