panelis-php/webhook 问题修复 & 功能扩展

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

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

panelis-php/webhook

Composer 安装命令:

composer require panelis-php/webhook

包简介

Generic webhook manager for Panelis CMS.

README 文档

README

A webhook manager for Laravel and Panelis applications.

Features

  • Register webhook vendors through configuration
  • Generic webhook handlers
  • Automatic route registration
  • Optional webhook logging
  • Queue-based logging
  • Composer-based Panelis plugin discovery

Requirements

  • PHP 8.3+
  • Laravel 13+
  • Filament 5+

Installation

Install the package via Composer:

composer require panelis-php/webhook

Publish the configuration file:

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

Publish the database migrations:

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

Run migrations:

php artisan migrate

Configuration

Configure your webhook vendors in config/webhook.php:

return [

    'prefix' => 'webhook',

    'vendors' => [

        'ping' => [
            'handler' => App\Webhook\PingWebhook::class,
        ],

    ],

];

This configuration automatically registers:

POST /webhook/ping

Creating a Handler

Create a webhook handler that implements the Webhook contract:

<?php

namespace App\Webhook;

use Illuminate\Http\Request;
use Panelis\Webhook\Contracts\Webhook;

class PingWebhook implements Webhook
{
    public function validate(Request $request): void
    {
        //
    }

    public function handle(Request $request): mixed
    {
        return response()->json([
            'message' => 'pong',
        ]);
    }
}

Logging

Webhook requests can be stored by enabling logging for a vendor:

'vendors' => [

    'ping' => [
        'handler' => App\Webhook\PingWebhook::class,
        'store' => true,
    ],

],

Logged requests are stored in the webhook_logs table.

Available fields:

  • ulid
  • vendor
  • event
  • status
  • payload
  • metadata
  • exception
  • processed_at

Example

Send a test request:

curl -X POST \
    http://localhost/webhook/ping \
    -H "Content-Type: application/json" \
    -d '{"hello":"world"}'

Response:

{
    "message": "pong"
}

Roadmap

  • Filament Resource
  • Webhook details page
  • Retry failed webhooks
  • Replay webhook payloads
  • Dashboard widgets
  • Failed webhook notifications

License

The MIT License (MIT).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固