我正在尝试检查记录是否存在,就像检查登录详细信息(电子邮件或用户名)是否起作用一样。
public function onCheckEmail()
{
return [ 'isTaken' => Auth ::findUserByLogin(post
( 'email' )) ? 1 : 0 ];
}
<label> Email address </label>
<input
name= "email"
type ="email"
class= "form-control"
data-request = "onCheckEmail"
data-request-success ="$('#loginTaken').toggle(!!data.isTaken)"
data-track-input />
</div>
<div id = "loginTaken" class= "alert alert-danger"
style = "display: none ">
Sorry, that login name is already taken.
</div>
我希望它与上述公司领域的工作方式相同。但是没有对上述内容进行任何更改