From e0b76a4cfb83fa89c535134f29b6317b6b36f155 Mon Sep 17 00:00:00 2001 From: Charlie Jennings Date: Mon, 15 Apr 2019 11:17:44 +0100 Subject: [PATCH] Fixing readme headings --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index cc85c8f..1c7315e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ Captain Hook + # Captain Hook ## Add Webhooks to your Laravel app, arrr @@ -48,6 +49,7 @@ Webhook::create([ - [License](#license) + ## Installation In order to add CaptainHook to your project, just add @@ -74,6 +76,7 @@ php artisan migrate ``` + ## Usage The CaptainHook service provider listens for any `eloquent.*` events. @@ -93,6 +96,7 @@ The event that gets called from Laravel will be: So this will be the event you want to listen for. + ### 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. @@ -109,6 +113,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 To remove an existing webhook from the system, use the `hook:delete` command. This command takes the webhook ID as an argument. @@ -118,6 +123,7 @@ php artisan hook:delete 2 ``` + ### List all active webhooks To list all existing webhooks, use the `hook:list` command. @@ -125,16 +131,19 @@ To list all existing webhooks, use the `hook:list` command. It will output all configured webhooks in a table. + ### Spark Install this package like stated in the [Installation section](#installation), then follow the [Spark installation instructions](spark.md). + ### Custom event listeners All listeners are defined in the config file located at `config/captain_hook.php`. + ### Receiving a webhook notification To receive the event data in your configured webhook, use: @@ -148,6 +157,7 @@ $event_json = json_decode($input); ``` + ### Webhook logging Starting with version 2.0, this package allows you to log the payload and response of the triggered webhooks. @@ -159,6 +169,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 Sometimes you don't want to use system wide webhooks, but rather want them scoped to a specific "tenant". @@ -192,6 +203,7 @@ To return only the webhooks for the currently logged in user, it might look like ``` + ## License CaptainHook is free software distributed under the terms of the MIT license.