diff --git a/README.md b/README.md index cc85c8f..c43ebc1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ Captain Hook + # Captain Hook ## Add Webhooks to your Laravel app, arrr @@ -47,8 +48,8 @@ Webhook::create([ - [Using webhooks with multi tenancy](#tenant) - [License](#license) - -## Installation + +## Installation In order to add CaptainHook to your project, just add @@ -73,8 +74,7 @@ php artisan vendor:publish --provider="Mpociot\CaptainHook\CaptainHookServicePro php artisan migrate ``` - -## Usage +## Usage The CaptainHook service provider listens for any `eloquent.*` events. @@ -92,8 +92,7 @@ The event that gets called from Laravel will be: So this will be the event you want to listen for. - -### Add new webhooks +### Add new webhooks If you know which event you want to listen to, you can add a new webhook by using the `hook:add` artisan command. @@ -108,8 +107,7 @@ php artisan hook:add http://www.myapp.com/hook/ 'eloquent.saved: \App\User' You can also add multiple webhooks for the same event, as all configured webhooks will get called asynchronously. - -### Delete existing webhooks +### Delete existing webhooks To remove an existing webhook from the system, use the `hook:delete` command. This command takes the webhook ID as an argument. @@ -117,25 +115,21 @@ To remove an existing webhook from the system, use the `hook:delete` command. Th php artisan hook:delete 2 ``` - -### List all active webhooks +### List all active webhooks To list all existing webhooks, use the `hook:list` command. It will output all configured webhooks in a table. - -### Spark +### Spark Install this package like stated in the [Installation section](#installation), then follow the [Spark installation instructions](spark.md). - -### Custom event listeners +### Custom event listeners All listeners are defined in the config file located at `config/captain_hook.php`. - -### Receiving a webhook notification +### Receiving a webhook notification To receive the event data in your configured webhook, use: @@ -147,8 +141,7 @@ $event_json = json_decode($input); // Do something with $event_json ``` - -### Webhook logging +### Webhook logging Starting with version 2.0, this package allows you to log the payload and response of the triggered webhooks. @@ -158,8 +151,7 @@ You can configure how many logs will be saved **per webhook** (Default 50). This value can be modified in the configuration file `config/captain_hook.php`. - -### Using webhooks with multi tenancy +### Using webhooks with multi tenancy Sometimes you don't want to use system wide webhooks, but rather want them scoped to a specific "tenant". This could be bound to a user or a team. @@ -191,8 +183,7 @@ To return only the webhooks for the currently logged in user, it might look like }, ``` - -## License +## License CaptainHook is free software distributed under the terms of the MIT license.