/** * Handle * @param User $user */ public function handle(User $user) { // Set last attempt timestamp $user->setLastLoginAt(new LastLoginAt()); $this->repository->persist($user); $this->repository->flush(); }
/** * Handle * @param Event $event */ public function handle($event) { $user = $this->repository->findByEmail(new Email($event['email'])); if ($user) { // Set last attempt timestamp $user->setLastAttemptAt(new LastAttemptAt()); $this->repository->persist($user); $this->repository->flush(); } }
/** * Handle * @param User $user */ public function handle(User $user) { if ($user && $user->isSuspended()) { $this->guard->logout(); throw new UserIsSuspendedException('You are temporarily suspended. Try again later.'); } elseif ($user && $user->getSuspendedTill()) { $user->unsetSuspended(); $this->repository->persist($user); $this->repository->flush(); } }
/** * Find a user by its credentials * @param array $credentials * @return mixed */ public function findByCredentials(array $credentials) { return $this->user->findByCredentials($credentials); }
/** * Retrieve a user by the given credentials. * @param array $credentials * @return Authenticatable|null */ public function retrieveByCredentials(array $credentials) { return $this->repository->findByCredentials($credentials); }