fares/google-meet-api
Composer 安装命令:
composer require fares/google-meet-api
包简介
PHP library to interact with Google Meet API via Google Calendar API
README 文档
README
A simple PHP package to generate Google Meet links via the Google Calendar API.
This package handles OAuth2 authentication, token management, and event creation, returning the Google Meet link automatically.
🚀 Features
- 🔑 Handles OAuth2 flow (Google login).
- 💾 Supports access & refresh tokens for long-term use.
- 📅 Creates Google Calendar events with Meet links.
- 🔗 Returns the Google Meet link directly.
- 🛠️ Easily extensible for listing/deleting events or adding attendees.
📦 Installation
Install via Composer:
composer require fares/google-meet-api
⚙️ Setup in Google Cloud
- Go to Google Cloud Console.
- Create a new project.
- Enable the Google Calendar API.
- Create OAuth 2.0 Client Credentials (Web Application).
- Add your redirect URI (e.g.
https://yourapp.com/oauth2callback). - Copy your Client ID and Client Secret.
📂 Package Structure
src/
├── GoogleMeetClient.php # Initializes Google Client
├── OAuthHandler.php # Manages login, tokens, refresh
├── MeetGenerator.php # Creates events and Meet links
🖥️ Usage Example
1️⃣ Initialize Client
use Fares\GoogleMeet\GoogleMeetClient; use Fares\GoogleMeet\OAuthHandler; require 'vendor/autoload.php'; $client = new GoogleMeetClient("CLIENT_ID", "CLIENT_SECRET", "https://yourapp.com/oauth2callback"); $oauth = new OAuthHandler($client->getClient()); // Step 1: Redirect user to Google login echo "<a href='".$oauth->getAuthUrl()."'>Login with Google</a>";
2️⃣ Handle Callback
// oauth2callback.php use Fares\GoogleMeet\OAuthHandler; use Fares\GoogleMeet\GoogleMeetClient; require 'vendor/autoload.php'; $client = new GoogleMeetClient("CLIENT_ID", "CLIENT_SECRET", "https://yourapp.com/oauth2callback"); $oauth = new OAuthHandler($client->getClient()); if (isset($_GET['code'])) { $tokens = $oauth->fetchTokens($_GET['code']); file_put_contents('token.json', json_encode($tokens)); // Save securely (DB recommended) echo "Authentication successful!"; }
3️⃣ Generate a Google Meet Link
use Fares\GoogleMeet\MeetGenerator; require 'vendor/autoload.php'; $client = new GoogleMeetClient("CLIENT_ID", "CLIENT_SECRET", "https://yourapp.com/oauth2callback"); $oauth = new OAuthHandler($client->getClient()); // Load saved token $oauth->setAccessToken(json_decode(file_get_contents('token.json'), true)); $oauth->refreshTokenIfNeeded(); // Create meeting $meet = new MeetGenerator($oauth->getClient()); $link = $meet->createMeeting( "Demo Meeting", "2025-09-20T10:00:00-07:00", "2025-09-20T10:30:00-07:00", "America/Los_Angeles" ); echo "Google Meet Link: " . $link;
⚠️ Notes
- You must use
conferenceDataVersion=1when inserting events, otherwise no Meet link will be generated. - Tokens should be stored securely (preferably in a database, not
token.json). - Each user must log in once with Google to grant permission.
📌 Future Improvements
- ✅ Database token manager (MySQL, SQLite, etc.)
- ✅ Event management (list, update, delete).
- ✅ Support for adding participants automatically.
📜 License
MIT License. Free to use and modify.
fares/google-meet-api 适用场景与选型建议
fares/google-meet-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「google api」 「google calendar」 「google meet」 「google meet api」 「google meet link」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fares/google-meet-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fares/google-meet-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fares/google-meet-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
Client for Google Directions API to add interpolated points to a route consisting of given coordinates.
Alfabank REST API integration
Google Recaptcha Package For PHP front and backend.
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-20