0
ERROR: 驗證器必須是類型的陣列中laravel5.3
我試圖登錄爲管理員,我所限定的警衛但在驗證器)的錯誤校驗(必須是158行中的類型數組。
BranchController:
public function authenticateBranchAdmin(Request $request){
$validator = Validator($request, [
Line 158-> 'email' => 'required|email',
'password' => 'required'
]);
if($validator->passes()){
if(Auth::guard('branch')->attempt([
'email' => $request->email,
'password' => $request->password,
])){
return redirect('/branch'.'/'.Auth::guard('branch')->id);
}else{
if($this->AdminIsVerified($request->email)){
$request->session()->flash('message', 'Invalid email or password!');
}else{
$request->session()->flash('message', 'Please Register this Account!');
}
return redirect('/Admin/login');
}
}else{
return redirect('/Admin/login')->withErrors($validator)->withInput();
}
}