定制 nicholasmt/zoom_webhook 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nicholasmt/zoom_webhook

Composer 安装命令:

composer require nicholasmt/zoom_webhook

包简介

a laravel package for zoom webhook end point verification and validation

README 文档

README

Laravel Package Library to verify and validate zoom webhook endpoint url

To get started Run

composer require nicholasmt/zoom_webhook

Note: if You encounter this or any other error which means you are using the old version of those packages

Your requirements could not be resolved to an installable set of packages.

To Resolve simply run

 composer update
 

After successfull composer update then install the package again with console composer require nicholasmt/zoom_webhook

Note: if you encounter any error based on poor network during update,

just backup the vender file, delete and run composer update again with console composer update

Configure .env file with below

ZOOM_SECRET_TOKEN="your zoom secret token"

Create a controller and require package using

use Nicholasmt\ZoomWebhook\Zoomwebhook;

Remember to excetp the route from csrf token verification under App/Http/middleware/VerifyCsrfToken.php

<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;

class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array<int, string>
     */
    protected $except = [
    
    //route url below
      'zoom/webhook',
       
      
     ];
}

Create a POST Route for the endpoint url

 Route::post('zoom/webhook', [App\Http\Controllers\ZoomWebhookController::class, 'webhook_handler'])->name('zoom-webhook');
 

To Verfiy the request header and Validate according to zoom webhook docs here is the code example using the library.

use Illuminate\Http\Request;
use Nicholasmt\ZoomWebhook\Zoomwebhook;

class ZoomWebhookController 
{
    public function webhook_handler()
    {
        // verify if is actually coming from zoom
        $verify_request_header = Zoomwebhook::VerifyHeader(); 
        if($verify_request_header)
        {
              //validate endpoint url
               $validate = Zoomwebhook::ValidateUrl();
               return $validate;
               
               //Comment out this after succefully validation
               
                //$validate = Zoomwebhook::ValidateUrl();
                 //return $validate;
               
        }
         
    }
}

Then after successful validation you will receive zoom events here

        $verify_request_header = Zoomwebhook::VerifyHeader(); 
        if($verify_request_header)
        {
          // trap zoom events here
        }

Use NGROK for testing Here , Check out ngrok Docs on how to use.

统计信息

  • 总下载量: 96
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-05