jubaer / zoom-laravel

为 Laravel 提供的全面 Zoom 集成包,通过 PHP 轻松与 Zoom 平台交互,提供易于使用的 API 功能。

1.3.0 2023-10-25 04:11 UTC

This package is auto-updated.

Last update: 2024-09-16 12:09:06 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Laravel Zoom API 客户端是一个强大且全面的包,旨在为 Laravel 用户提供一个统一和一致的方法将 Zoom API 集成到他们的应用程序中。使用此包,开发人员可以无缝地与功能丰富的 Zoom 视频通信平台交互,使他们能够轻松地创建、管理和增强他们的 Zoom 会议和网络研讨会。

安装

您可以通过 composer 安装此包

composer require jubaer/zoom-laravel

配置文件

发布配置文件

php artisan vendor:publish --provider="Jubaer\Zoom\ZoomServiceProvider"

然后在 config/app.php 中添加

'providers' => [
    // ...
    Jubaer\Zoom\ZoomServiceProvider::class,
];

然后在 config/app.php 中添加

'aliases' => [
    // ...
    'Zoom' => Jubaer\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 凭据

  • 访问 https://marketplace.zoom.us/develop/create 并创建一个 Server-to-Server OAuth 应用
  • 然后点击“继续”
  • 填写表单并点击“继续”
  • 然后点击“继续”
  • 然后点击“添加作用域”
  • 然后标记所有作用域并点击“完成”
  • 然后点击“继续”
  • 然后激活您的应用
  • 然后复制您的 API 密钥和 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);

获取所有用户

    $users = Zoom::getUsers(['status' => 'active']); // values are 'active', 'inactive', 'pending'. default is active. and you can pass page_size and page_number as well

变更日志

请参阅 CHANGELOG 了解最近更改的详细信息。

安全

如果您发现任何安全相关的问题,请通过电子邮件 jubaer01.cse@gmail.com 而不是使用问题跟踪器。

致谢

许可证

MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。