Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing readme headings #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<img src="http://www.marcelpociot.com/git/hook.png" style="width: 100%" alt="Captain Hook" />

# Captain Hook
## Add Webhooks to your Laravel app, arrr

Expand Down Expand Up @@ -48,6 +49,7 @@ Webhook::create([
- [License](#license)

<a name="installation" />

## Installation

In order to add CaptainHook to your project, just add
Expand All @@ -74,6 +76,7 @@ php artisan migrate
```

<a name="usage" />

## Usage

The CaptainHook service provider listens for any `eloquent.*` events.
Expand All @@ -93,6 +96,7 @@ The event that gets called from Laravel will be:
So this will be the event you want to listen for.

<a name="add" />

### 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.
Expand All @@ -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.

<a name="delete" />

### 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.
Expand All @@ -118,23 +123,27 @@ php artisan hook:delete 2
```

<a name="list" />

### List all active webhooks

To list all existing webhooks, use the `hook:list` command.

It will output all configured webhooks in a table.

<a name="spark" />

### Spark

Install this package like stated in the [Installation section](#installation), then follow the [Spark installation instructions](spark.md).

<a name="listeners" />

### Custom event listeners

All listeners are defined in the config file located at `config/captain_hook.php`.

<a name="webhook" />

### Receiving a webhook notification

To receive the event data in your configured webhook, use:
Expand All @@ -148,6 +157,7 @@ $event_json = json_decode($input);
```

<a name="logging" />

### Webhook logging

Starting with version 2.0, this package allows you to log the payload and response of the triggered webhooks.
Expand All @@ -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`.

<a name="tenant" />

### Using webhooks with multi tenancy

Sometimes you don't want to use system wide webhooks, but rather want them scoped to a specific "tenant".
Expand Down Expand Up @@ -192,6 +203,7 @@ To return only the webhooks for the currently logged in user, it might look like
```

<a name="license" />

## License

CaptainHook is free software distributed under the terms of the MIT license.
Expand Down