ayodvr/laravel-webhook-manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ayodvr/laravel-webhook-manager

Composer 安装命令:

composer require ayodvr/laravel-webhook-manager

包简介

A reusable package for Laravel that allows developers to receive, process, and manage incoming webhooks reliably.

README 文档

README

Latest Stable Version Total Downloads License

A reusable Laravel package for receiving, processing, and managing incoming webhooks reliably. It handles webhooks from multiple providers, prevents duplicates, and ensures high reliability for critical backend systems.

Features

  • Signature Verification: Ensures incoming requests are authentic using HMAC-SHA256.
  • Automatic Duplicate Prevention: Uses unique provider IDs (Stripe ID, GitHub Delivery ID, etc.) or signatures to prevent duplicate processing.
  • Reliable Processing: Queue-based asynchronous processing with automatic status tracking and retries.
  • Event Dispatching: Fires Laravel events (WebhookReceived) for easy integration.
  • Configurable: Customizable route prefix, retry intervals, queue names, and signature secrets.
  • Multiple Providers: Built-in support for Paystack, Stripe, PayPal, GitHub, and more.
  • Interactive Demo: Includes a built-in dashboard to simulate and monitor webhooks.

Installation

Requirements

  • PHP: ^8.2
  • Laravel: ^10.0 || ^11.0 || ^12.0

Via Composer

composer require ayodvr/laravel-webhook-manager

Publish Configuration

Publish the configuration file:

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

Publish Migration

Run the migration to create the webhook events table:

php artisan migrate

Set your webhook signature secret in your .env file:

WEBHOOK_SIGNATURE_SECRET=your-secret-key-here

Interactive Demo

The package comes with a built-in demo dashboard to help you test and visualize the webhook flow.

  1. Start the server:
    php artisan serve
  2. Access the dashboard: Navigate to http://127.0.0.1:8000/demo in your browser.
  3. Simulate Webhooks: Click the "Simulate Paystack Payment" button to trigger a mock signed webhook and watch it process in real-time.

Usage

Receiving Webhooks

Webhooks are automatically handled at the /webhooks/{provider} route (configurable via route_prefix). For example:

  • Paystack: POST /webhooks/paystack
  • Stripe: POST /webhooks/stripe
  • PayPal: POST /webhooks/paypal

Listening to Webhooks

Listen to the WebhookReceived event in your EventServiceProvider or using a Listener:

<?php

namespace App\Listeners;

use Cybrox\WebhookManager\Events\WebhookReceived;

class ProcessWebhook
{
    public function handle(WebhookReceived $event): void
    {
        $webhookEvent = $event->webhookEvent;

        // Process based on provider
        if ($webhookEvent->provider === 'paystack') {
            $payload = json_decode($webhookEvent->payload, true);
            // Your logic here...
        }
    }
}

Configuration Options

Edit config/webhook-manager.php to customize behavior:

return [
    'route_prefix' => env('WEBHOOK_ROUTE_PREFIX', 'webhooks'),
    'signature_secret' => env('WEBHOOK_SIGNATURE_SECRET'),
    'max_attempts' => env('WEBHOOK_MAX_ATTEMPTS', 3),
    'queue' => env('WEBHOOK_QUEUE', 'webhooks'),
    'providers' => ['stripe', 'paypal', 'github', 'paystack'],
];

Testing

Run the test suite:

php artisan test

Contributing

Contributions are welcome! Please see the contributing guide for more details.

License

This package is open-sourced software licensed under the MIT license.

ayodvr/laravel-webhook-manager 适用场景与选型建议

ayodvr/laravel-webhook-manager 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「manager」 「events」 「laravel」 「webhook」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ayodvr/laravel-webhook-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ayodvr/laravel-webhook-manager 我们能提供哪些服务?
定制开发 / 二次开发

基于 ayodvr/laravel-webhook-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-16