protected function loginUser($credential, $password) { $user = User::where($this->credential, $credential)->firstOrFail(); if (password_verify($password, $user->password)) { return $user; } }