我想使用数字而不是电子邮件登录:所以,我将代码更改为:<div class="panel-body"> <form class="form-horizontal" method="POST" action="{{ route('login') }}"> {{ csrf_field() }} <div class="form-group{{ $errors->has('matric_no') ? ' has-error' : '' }}"> <label for="matric_no" class="col-md-4 control-label">Matric No</label> <div class="col-md-6"> <input id="matric_no" class="form-control" type="number" name="matric_no" value="{{ old('matric_no') }}" required autofocus> @if ($errors->has('matric_no')) <span class="help-block"> <strong>{{ $errors->first('matric_no') }}</strong> </span> @endif </div></div>但是每次我尝试登录时,错误都是:电子邮件字段是必需的。
1 回答

一只名叫tom的猫
TA贡献1906条经验 获得超3个赞
将此代码插入您的 LoginController
public function username()
{
return 'matric_no';
}
- 1 回答
- 0 关注
- 79 浏览
添加回答
举报
0/150
提交
取消