se468 / laravel-rest-hooks
Package that handles subscribing, deleting, and firing REST Hooks.
dev-master
2018-05-05 07:31 UTC
Requires
- php: >=5.5.9
- illuminate/filesystem: ~5.5
- illuminate/mail: ~5.5
- illuminate/support: ~5.5
Requires (Dev)
- mockery/mockery: ~0.9.2|~1.0.0
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~6.0
This package is not auto-updated.
Last update: 2024-11-01 22:31:23 UTC
README
Package that handles subscribing, deleting, and firing REST Hooks.
How to use
composer require se468/laravel-rest-hooks php artisan migrate
Usage
Subscribe a webhook endpoint
POST /api/hooks
with data
data:
{
"target_url": "https://rest-hook-target.com/<unique_path>", //Your Hook URL
"event": "user_created" //Your Hook Event
}
Will create a new RestHook and store it.
Delete a webhook endpoint
DELETE /api/hooks/{id}
Will delete RestHook with that id.
Firing RestHook with Data
$data = [ 'foo' => 'bar' ]; $resthook = RestHook::find(1); $resthook->fire($data);