问题描述
我安装了一个带有 bootstrap auth 的新 Laravel 8。
我将 first_name 和 last_name 添加到用户表和注册控制器验证、刀片等中。
我的表格:
<form method="POST" action="{{ route('register') }}">
@csrf
<div class="form-group row">
<label for="first_name" class="col-md-4 col-form-label text-md-right">First Name</label>
<div class="col-md-6">
<input id="first_name" type="text" class="form-control @error('first_name') is-invalid @enderror" name="first_name" value="{{ old('first_name') }}" required autocomplete="first_name" autofocus>
@error('first_name')
<span class="invalid-Feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>.... and the rest of the fields
我尝试在不填写任何字段的情况下注册用户。
这些字段带有红色边框,第一个字段 (first_name) 会显示带有消息的工具提示,请填写此字段。
但我没有看到每个字段下应该出现的错误消息:
@error('first_name')
<span class="invalid-Feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
我该怎么做?为什么会忽略刀片文件中的@error 语句?
我也没有看到它在开发控制台中的位置,当我点击提交时,我在控制台中没有看到任何东西。
这里发生了什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)