follow Google Docs to obtain your ClientId, ClientSecret & refreshToken
you can also check This Example for a better understanding.
$client = new \Google_Client();
$client->setClientId('[app client id].apps.googleusercontent.com');
$client->setClientSecret('[app client secret]');
$client->refreshToken('[your refresh token]');
$service = new \Google_Service_Drive($client);
$adapter = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, '['root' or folder ID]');
/* Recommended cached adapter use */// $adapter = new \League\Flysystem\Cached\CachedAdapter(// new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, '['root' or folder ID]'),// new \League\Flysystem\Cached\Storage\Memory()// );$filesystem = new \League\Flysystem\Filesystem($adapter);