hello-one/laravel-webhooks

Parse incoming webhook requests from hello-one.de

0.1.1 2020-05-17 02:28 UTC

This package is auto-updated.

Last update: 2024-11-18 10:30:24 UTC


README

Securely receive Webhooks from your hello one project.

Installation

  1. You can install this package via composer using the following command:

    composer require hello-one/laravel-webhooks

    The package will automatically register itself using package discovery.

  2. Add your app as a webhook on our dashboard. The default route is

    https://{{yourdomain.com}}/hello-one/webhook
    

    Please note: we only support TLS endpoints ("https only")

  3. Copy the secret signing key

  4. Add the secret signing key to your .env file

    HELLO_ONE_WEBHOOK_SIGNING_SECRET={{INSERT_TOKEN_HERE}
  5. Your app will now receive events from your hello one project. You can test the integration by sending a test-event from our dashboard

Usage

This package handles incoming webhook requests from hello one. It verifies the request signature of hello one webhook requests. When a request is valid the package emits and emits a Laravel Event

To react on any of the events you can create an event listener.

Listen to all webhook events with a wildcard:

Event::listen('hello-one.webhook.*', function (string $eventName, array $data) {
    Log::info('hello one event received: '.  $eventName, $data);
});

Listen to specific events:

Event::listen('hello-one.webhook.guest.created', function (string $eventName, array $data) {
    Log::info('A new Guest was just created', $data['guest']['id']);
    // use the data from $data['guest'] 
});

Event List

You can query the complete event list from our API

curl -X GET "https://api.hello-one.de/api/webhooks/events" -H  "accept: application/json"

Please note: in Laravel all events are prefixed with hello-one.webhook.

Configuration

Publish the config file and adjust as needed

 php artisan vendor:publish --tags 'hello-one-webhooks'

Documentation

Please notice our Webhook Documentation

Contributing

Feel free to open a ticket, submit a Pull Request or ask our Support Team