public function setAccessToken($token)
    {
        /**
         * @var Client $google
         */
        $google = Container::getInstance()->make(Client::class);

        $google->getCache()->clear();

        $google->setAccessToken($token);

        if (isset($token['refresh_token']) and $google->isAccessTokenExpired()) {
            $google->fetchAccessTokenWithRefreshToken();
        }

        return $this->setService($google->make('sheets'))
                    ->setDriveService($google->make('drive'));
    }
public function setAccessToken($token)
    {
        /**
         * @var Client $google
         */
        $google = Container::getInstance()->make(Client::class);

        $google->getCache()->clear();

        $google->setAccessToken($token);

        if (isset($token['refresh_token']) and $google->isAccessTokenExpired()) {
            $google->fetchAccessTokenWithRefreshToken();
        }

        return $this->setService($google->make('sheets'))
                    ->setDriveService($google->make('drive'));
    }
public function setAccessToken ( $ token ) { /**
         * @var Client $google
         */ $ google = Container :: getInstance ( ) -> make ( Client :: class ) ; $ google -> getCache ( ) -> clear ( ) ; $ google -> setAccessToken ( $ token ) ; if ( isset ( $ token [ 'refresh_token' ] ) and $ google -> isAccessTokenExpired ( ) ) { $ google -> fetchAccessTokenWithRefreshToken ( ) ; } return $ this -> setService ( $ google -> make ( 'sheets' ) ) -> setDriveService ( $ google -> make ( 'drive' ) ) ; }
set access_token and set new service

@param string|array $token

@return $this
@throws \Exception
set access_token and set new service