ghanem / laravel-zoom
为 Laravel 提供的全面 Zoom 集成包,使用 PHP 与 Zoom 平台交互,提供易于使用的 API 功能。
1.3.1
2023-08-07 17:50 UTC
Requires
- php: ^7.2|^8.0
- guzzlehttp/guzzle: ^7.6
README
Laravel Zoom API 包
安装
您可以通过 composer 安装此包
composer require Ghanem/zoom-laravel
配置文件
发布配置文件
php artisan vendor:publish --provider="Ghanem\Zoom\ZoomServiceProvider"
然后添加 config/app.php
'providers' => [ // ... Ghanem\Zoom\ZoomServiceProvider::class, ];
然后添加 config/app.php
'aliases' => [ // ... 'Zoom' => Ghanem\Zoom\Facades\Zoom::class, ];
这将创建一个位于您的配置目录下的 zoom.php 配置文件,用于常规用户设置:
return [ 'client_id' => env('ZOOM_CLIENT_KEY'), 'client_secret' => env('ZOOM_CLIENT_SECRET'), 'account_id' => env('ZOOM_ACCOUNT_ID'), 'base_url' => 'https://api.zoom.us/v2/', ];
对于特定用户的 Zoom 配置,请添加 User 模型
public static function clientID() { return 'zoom_client_of_user'; } public static function clientSecret() { return 'zoom_client_secret_of_user'; } public static function accountID() { return 'zoom_account_id_of_user'; }
如何获取 Zoom API 凭据
- 要了解如何创建 zoom api 和获取凭据,请点击 这里
用法
目前我们涵盖了以下模块
- 用户
- 会议
- 过去的会议
- 网络研讨会
- 过去的网络研讨会
- 录音
- 过去的录音
通用获取函数
创建会议
$meetings = Zoom::createMeeting([ "agenda" => 'your agenda', "topic" => 'your topic', "type" => 2, // 1 => instant, 2 => scheduled, 3 => recurring with no fixed time, 8 => recurring with fixed time "duration" => 60, // in minutes "timezone" => 'Asia/Dhaka', // set your timezone "password" => 'set your password', "start_time" => 'set your start time', // set your start time "template_id" => 'set your template id', // set your template id Ex: "Dv4YdINdTk+Z5RToadh5ug==" from https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingtemplates "pre_schedule" => false, // set true if you want to create a pre-scheduled meeting "schedule_for" => 'set your schedule for profile email ', // set your schedule for "settings" => [ 'join_before_host' => false, // if you want to join before host set true otherwise set false 'host_video' => false, // if you want to start video when host join set true otherwise set false 'participant_video' => false, // if you want to start video when participants join set true otherwise set false 'mute_upon_entry' => false, // if you want to mute participants when they join the meeting set true otherwise set false 'waiting_room' => false, // if you want to use waiting room for participants set true otherwise set false 'audio' => 'both', // values are 'both', 'telephony', 'voip'. default is both. 'auto_recording' => 'none', // values are 'none', 'local', 'cloud'. default is none. 'approval_type' => 0, // 0 => Automatically Approve, 1 => Manually Approve, 2 => No Registration Required ], ]);
获取会议
$meeting = Zoom::getMeeting($meetingId);
更新会议
$meeting = Zoom::updateMeeting($meetingId, [ "agenda" => 'your agenda', "topic" => 'your topic', "type" => 2, // 1 => instant, 2 => scheduled, 3 => recurring with no fixed time, 8 => recurring with fixed time "duration" => 60, // in minutes "timezone" => 'Asia/Dhaka', // set your timezone "password" => 'set your password', "start_time" => 'set your start time', // set your start time "template_id" => 'set your template id', // set your template id Ex: "Dv4YdINdTk+Z5RToadh5ug==" from https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingtemplates "pre_schedule" => false, // set true if you want to create a pre-scheduled meeting "schedule_for" => 'set your schedule for profile email ', // set your schedule for "settings" => [ 'join_before_host' => false, // if you want to join before host set true otherwise set false 'host_video' => false, // if you want to start video when host join set true otherwise set false 'participant_video' => false, // if you want to start video when participants join set true otherwise set false 'mute_upon_entry' => false, // if you want to mute participants when they join the meeting set true otherwise set false 'waiting_room' => false, // if you want to use waiting room for participants set true otherwise set false 'audio' => 'both', // values are 'both', 'telephony', 'voip'. default is both. 'auto_recording' => 'none', // values are 'none', 'local', 'cloud'. default is none. 'approval_type' => 0, // 0 => Automatically Approve, 1 => Manually Approve, 2 => No Registration Required ], ]);
删除会议
$meeting = Zoom::deleteMeeting($meetingId);
获取所有会议
$meetings = Zoom::getAllMeeting();
获取会议
$meeting = Zoom::getMeeting($meetingId);
获取所有即将到来的会议
$meetings = Zoom::getUpcomingMeeting();
获取所有过去的会议
$meetings = Zoom::getPreviousMeetings();
重新安排会议
$meetings = Zoom::rescheduleMeeting($meetingId, [ "agenda" => 'your agenda', "topic" => 'your topic', "type" => 2, // 1 => instant, 2 => scheduled, 3 => recurring with no fixed time, 8 => recurring with fixed time "duration" => 60, // in minutes "timezone" => 'Asia/Dhaka', // set your timezone "password" => 'set your password', "start_time" => 'set your start time', // set your start time "template_id" => 'set your template id', // set your template id Ex: "Dv4YdINdTk+Z5RToadh5ug==" from https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingtemplates "pre_schedule" => false, // set true if you want to create a pre-scheduled meeting "schedule_for" => 'set your schedule for profile email ', // set your schedule for "settings" => [ 'join_before_host' => false, // if you want to join before host set true otherwise set false 'host_video' => false, // if you want to start video when host join set true otherwise set false 'participant_video' => false, // if you want to start video when participants join set true otherwise set false 'mute_upon_entry' => false, // if you want to mute participants when they join the meeting set true otherwise set false 'waiting_room' => false, // if you want to use waiting room for participants set true otherwise set false 'audio' => 'both', // values are 'both', 'telephony', 'voip'. default is both. 'auto_recording' => 'none', // values are 'none', 'local', 'cloud'. default is none. 'approval_type' => 0, // 0 => Automatically Approve, 1 => Manually Approve, 2 => No Registration Required ], ]);
结束会议
$meetings = Zoom::endMeeting($meetingId);
删除会议
$meetings = Zoom::deleteMeeting($meetingId);
恢复会议
$meetings = Zoom::recoverMeeting($meetingId);
创建用户
$meetings = Zoom::createUsers([ 'action' => 'create', 'user_info' => [ 'email' => 'email@gmail.com', "type" => 1, ], ]);
获取所有用户
$users = Zoom::getUsers(['status' => 'active']); // values are 'active', 'inactive', 'pending'. default is active. and you can pass page_size and page_number as well
检查用户邮箱
$users = Zoom::checkUserEmail('email@email.com');
变更日志
请参阅 变更日志 了解最近更改的详细信息。
安全
如果您发现任何安全问题,请通过电子邮件 Ghanem01.cse@gmail.com 而不是使用问题跟踪器。
鸣谢
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件。