public function start(Impersonatable $impersonater, Impersonatable $impersonated)
    {
        $this->checkImpersonation($impersonater, $impersonated);

        try {
            session()->put($this->getSessionKey(), $impersonater->getAuthIdentifier());
            $this->auth()->silentLogout();
            $this->auth()->silentLogin($impersonated);

            $this->events()->dispatch(
                new Events\ImpersonationStarted($impersonater, $impersonated)
            );

            return true;
        }
        catch (\Exception $e) {
            return false;
        }
    }
public function start(Impersonatable $impersonater, Impersonatable $impersonated)
    {
        $this->checkImpersonation($impersonater, $impersonated);

        try {
            session()->put($this->getSessionKey(), $impersonater->getAuthIdentifier());
            $this->auth()->silentLogout();
            $this->auth()->silentLogin($impersonated);

            $this->events()->dispatch(
                new Events\ImpersonationStarted($impersonater, $impersonated)
            );

            return true;
        }
        catch (\Exception $e) {
            return false;
        }
    }
public function start ( Impersonatable $ impersonater , Impersonatable $ impersonated ) { $ this -> checkImpersonation ( $ impersonater , $ impersonated ) ; try { session ( ) -> put ( $ this -> getSessionKey ( ) , $ impersonater -> getAuthIdentifier ( ) ) ; $ this -> auth ( ) -> silentLogout ( ) ; $ this -> auth ( ) -> silentLogin ( $ impersonated ) ; $ this -> events ( ) -> dispatch ( new Events \ ImpersonationStarted ( $ impersonater , $ impersonated ) ) ; return true ; } catch ( \ Exception $ e ) { return false ; } }
Start the impersonation.

@param  \Arcanedev\LaravelImpersonator\Contracts\Impersonatable  $impersonater
@param  \Arcanedev\LaravelImpersonator\Contracts\Impersonatable  $impersonated

@return bool
Start the impersonation .