示例#1
0
 /**
  * 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();
     }
 }