承接 terpise/laravel-webhook 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

terpise/laravel-webhook

最新稳定版本:1.0.9

Composer 安装命令:

composer require terpise/laravel-webhook

包简介

Laravel webhook

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A webhook is a way for an app to provide information to another app about a particular event. The way the two apps communicate is with a simple HTTP request.

Installation

You can install the package via composer:

composer require terpise/laravel-webhook

You can publish the config file with:

php artisan vendor:publish --tag=webhook-config

You can publish the migrations file with:

php artisan vendor:publish --tag=webhook-migrations

Run migrations:

php artisan migrate

You can make client with:

php artisan webhook:make
php artisan queue:work

Client

Setup callback:

Route::get('callback', [WebhookClientController::class, 'verify'])->middleware(VerifyToken::class);
Route::post('callback', [WebhookClientController::class, 'callback'])->middleware(VerifyToken::class);

// verify use callback authentication when registering
// callback method you can get data from webhook
// middleware for checking the authenticity of the callback, use 'verify_token'

public function verify(Request $request)
{
    return new Response(['challenge' => $request->get('challenge')]);
}

Create subscribe:

$  curl -X POST https://www.domain.com/webhooks/subscribe \
      -F client_id=10 \
      -F client_secret=7b2946535949ae70f015d696d8ac602830ece412 \
      -F callback_url=https://www.domain-client.com/callback \
      -F verify_token=5359435949ae70f015d694656d8ac6

View subscribe:

$  curl -X GET https://www.domain.com/webhooks/subscribe \
      -F client_id=10 \
      -F client_secret=7b2946535949ae70f015d696d8ac602830ece412

Unsubscribe:

$  curl -X POST https://www.domain.com/webhooks/unsubscribe \
      -F client_id=10 \
      -F client_secret=7b2946535949ae70f015d696d8ac602830ece412

Use

WebhookEvent::dispatch([
    "event_time" => now(),
    "event_type" => 'create',
    "object_id" => 888888,
    "object_type" => "users",
]);

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固