Php 拉威尔验证规则';相同';总是失败

Php 拉威尔验证规则';相同';总是失败,php,laravel,laravel-5,laravel-5.4,Php,Laravel,Laravel 5,Laravel 5.4,控制器中的验证 $this->validate($req, [ 'password' => ['required', 'string', 'min: 6', 'same: conf_password'], 'conf_password' => ['required', 'string', 'min: 6', 'same: password'], ]); 看法 它总是返回false,即使我将其更改为confirmativerule with It\u confirm

控制器中的验证

$this->validate($req, [
  'password' => ['required', 'string', 'min: 6', 'same: conf_password'],
  'conf_password' => ['required', 'string', 'min: 6', 'same: password'],
]);
看法


它总是返回false,即使我将其更改为
confirmative
rule with It
\u confirmation
后缀规范,也会返回false


但是我做了
dd($req->password==$req->conf_password)
,它返回true。发生了什么事?

删除

之后的空格你是否尝试删除
之后的空格?@cweiske谢谢你,伙计,你救了我的命。我搜索了3个小时,只搜索了空间。为什么不使用
确认
?@RossWilson我做了,但什么也没发生,仍然失败。为什么
相同的
规则有严格的格式,而regex、min和其他规则没有。天哪,为拉威尔打开一个bug。@Yosalijantobinar,请记住接受这个答案。
<input id="password" type="password" class="form-control" name="password" 
  placeholder="Enter password" value="{{ old('password') }}">

<input id="conf_password" type="password" class="form-control" 
   name="conf_password" placeholder="Enter password once again"
   value="{{ old('conf_password') }}">