logout() public méthode

Logs the current user out.
public logout ( Cartalyst\Sentinel\Users\UserInterface $user = null, boolean $everywhere = false ) : boolean
$user Cartalyst\Sentinel\Users\UserInterface
$everywhere boolean
Résultat boolean
 public function getLogout()
 {
     try {
         if (!!($user = $this->sentinel->check())) {
             $this->setResponseData($this->sentinel->logout(null, true));
         } else {
             throw new \Exception("Can't get current user");
         }
     } catch (\Exception $e) {
         $this->setErrorData($e->getMessage());
     }
     return $this->responseJson();
 }
Exemple #2
0
 /**
  * Logs the current user out.
  *
  * @param  User $user
  * @param  bool $everywhere
  *
  * @return bool
  */
 public function logout(User $user = null, $everywhere = false)
 {
     return $this->sentinel->logout($user, $everywhere);
 }
 /**
  * Logs the current user out.
  *
  * @param \Cartalyst\Sentinel\Users\UserInterface $user
  * @param bool $everywhere
  * @return bool 
  * @static 
  */
 public static function logout($user = null, $everywhere = false)
 {
     return \Cartalyst\Sentinel\Sentinel::logout($user, $everywhere);
 }
 /**
  * {@inheritDoc}
  */
 public function logout()
 {
     return $this->sentinel->logout();
 }