yisus-vault / google-facade
A beginner-friendly Google facade for PHP.
v0.1.0
2026-05-12 03:41 UTC
Requires
- google/apiclient: ^2.15
Requires (Dev)
- phpunit/phpunit: ^10
This package is auto-updated.
Last update: 2026-07-12 04:06:53 UTC
README
Easily connect and interact with the Google API using PHP. This package wraps the complex google/apiclient into simple, intuitive commands, supporting both object-oriented and Laravel-style static calls.
Installation
composer require yisus-vault/google-facade
Usage
1. Setup (One-time)
Initialize the client once at the start of your application (e.g., in a ServiceProvider or config file).
use Yisus\GoogleFacade\Auth\ClientManager; ClientManager::create([ 'auth_type' => 'service_account', 'credentials' => __DIR__ . '/credentials.json' ]);
2. Use it Anywhere (Laravel-style Static Call)
Once initialized, you can call Drive methods statically from anywhere in your code.
use Yisus\GoogleFacade\Facades\Drive; // Upload $fileId = Drive::uploadFile('path/to/local/file.jpg', 'My Image.jpg'); // List $files = Drive::listFolder('root'); // Download Drive::downloadFile('file_id', 'local.jpg');
3. Standard Object-Oriented Usage
If you prefer instances or need multiple clients:
use Yisus\GoogleFacade\Auth\ClientManager; use Yisus\GoogleFacade\Drive\DriveFacade; $client = ClientManager::create([...]); $drive = new DriveFacade($client); $drive->uploadFile(...);
Contributing
This project is part of the Yisus Vault ecosystem.