This is code here:
protected function credentials(Request $request) { $admin=admin::where('email',$request->email)->first(); if(count($admin)) { if($admin->status==0){ return ['email'=>'inactive','password'=>'You are not an active person, Please contact to admin']; } else{ return ['email'=>$request->email,'password'=>$request->password,'status'=>1]; } } return $request->only($this->username(), 'password'); }
When i run the code this error become:
"count(): Parameter must be an array or an object that implements Countable"
This is my solution:
count(array($variable));
hope it works!
It happens because of in PHP 7.2 NULL in count() return Warning. You can try to change
count($admin)
to
count((is_countable($admin)?$admin:[]))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With