marjose123 / filament-webhook-server
Send webhooks from your filament apps
Fund package maintenance!
marjose123
Installs: 2 714
Dependents: 1
Suggesters: 0
Security: 0
Stars: 38
Watchers: 1
Forks: 12
Open Issues: 0
Requires
- php: ^8.0 || ^8.1 || ^8.2
- filament/filament: ^3.0
- illuminate/contracts: ^9.0 || ^10.0 || ^11.0
- spatie/laravel-model-info: ^1.4 || ^2.0
- spatie/laravel-package-tools: ^1.13.5
- spatie/laravel-webhook-server: ^3.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- laravel/pint: ^1.4
- nunomaduro/collision: ^6.0 || ^7.0
- orchestra/testbench: ^7.0 || ^9.0
- pestphp/pest: ^1.22
- pestphp/pest-plugin-laravel: ^1.1
- pestphp/pest-plugin-livewire: ^1.0
- pestphp/pest-plugin-parallel: ^0.3
- phpmd/phpmd: ^2.13
- phpunit/phpunit: ^9.5 || ^10.0 || ^10.5
- spatie/laravel-ray: ^1.26
- squizlabs/php_codesniffer: ^3.7
README
This package provides a Filament page that you can send webhook server . You'll find installation instructions and full documentation on spatie/laravel-webhook-server.
🚨 _For latest version that support FilamentPhp v2.x use this branch 1.x_or released version "^1.0"
Installation
You can install the package via composer:
composer require marjose123/filament-webhook-server:"^2.0"
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-webhook-server-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="filament-webhook-server-config"
This is the contents of the published config file:
return [ /* * Models that you want to be part of the webhooks options */ 'models' => [ \App\Models\User::class, ], /* */ 'polling' => '10s' ];
Add the plugin to your panel and you're ready to go
use Marjose123\FilamentWebhookServer\WebhookPlugin; public function panel(Panel $panel): Panel { return $panel // ... ->plugins([ WebhookPlugin::make() // <- Add this ]); }
Usage
- Add the models that you want to be part of the webhook
- This package will automatically register the
Webhook-Server
. You'll be able to see it when you visit your Filament admin panel.
Customising the polling interval
You can customise the polling interval for the Webhook-Server
by publishing the configuration file and updating the polling
value.
Webhook payload Structure
[
{
"event": "created", // <== Type of Event
"module": "Testing", // <== Module that were the event happend
"triggered_at": "2023-01-18T05:07:37.748031Z", // <== Based on the Date and time the Event happen
"data": { // <== Actual information depending on what you selected "Summary, All or Custom"
"id": 34,
"created_at": "2023-01-18T05:07:37.000000Z"
}
}
]
for custom option you need to create toWebhookPayload method in your models
public function toWebhookPayload()
{
return [
'customAttribute' => $this->yourAttribute
];
}
Testing
composer test
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.