public function authenticate($code)
    {
        if ( $code )
        {
            $this->client->authenticate($code);

            $access_token = $this->client->getAccessToken();

            $this->session->put('googleapi_token', $access_token);

            return true;
        }

        return false;
    }
public function authenticate($code)
    {
        if ( $code )
        {
            $this->client->authenticate($code);

            $access_token = $this->client->getAccessToken();

            $this->session->put('googleapi_token', $access_token);

            return true;
        }

        return false;
    }
public function authenticate ( $ code ) { if ( $ code ) { $ this -> client -> authenticate ( $ code ) ; $ access_token = $ this -> client -> getAccessToken ( ) ; $ this -> session -> put ( 'googleapi_token' , $ access_token ) ; return true ; } return false ; }
Authenticate with Google and get access token
@param  string $code - The OAuth2 callback code
@return bool
Authenticate with Google and get access token