Skip to content

se468/laravel-rest-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Laravel REST Hooks

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);

About

Package that handles REST hooks in Laravel

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages