yisus-vault/google-facade
最新稳定版本:v0.1.0
Composer 安装命令:
composer require yisus-vault/google-facade
包简介
A beginner-friendly Google facade for PHP.
README 文档
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.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-12