Webhooks

Created by Igniter Labs
  139 installs

Connect your third party apps via Zapier or other third-party services to your TastyIgniter website.

  • Version:
    v1.1.1
  • Last Updated:
    1 month ago
  • Published:
    23 Sep 21
  • License:
  • Public repository:

Webhooks extension allows you to perform certain action on your TastyIgniter from somewhere else.

It turns your site into a powerful optimized webhook system so that your site can communicate with your third party apps like Zapier. Under the hood, this extension uses spatie/laravel-webhook-server

Usage

In the admin user interface:

  • Go to System > Settings > Webhooks Settings to configure the extension settings
  • Go to Tools > Webhooks to manage outgoing webhooks.
  • Go to Tools > Automations to automate outgoing webhooks when certain events happen.

For example:

  • Send data to OpenTable when a new reservation is made on your TastyIgniter website.
  • Send data to your POS when a new order is placed on your TastyIgniter website.

Features

  • Send data when certain events happen in your TastyIgniter platform.
  • Advanced settings for each outgoing webhook
  • Supports JSON and form urlencode
  • Supports Zapier, automate.io and more.

Advanced

Example of Registering Webhook Events

Here is an example of an extension registering a webhook event to trigger an outgoing webhook.

public function registerWebhookEvents()
{
    return [
        'events' => [
            'customer' => \IgniterLabs\Webhook\WebhookEvents\Customer::class,
        ],
    ];
}

Example of a Webhook Event Class

A webhook event class is responsible for preparing the parameters passed to the outgoing webhook.

class Customer extends \IgniterLabs\Webhook\WebhookEvents\BaseEvent
{
    /**
     * Returns information about this event, including name and description.
     */
    public function eventDetails()
    {
        return [
            'name' => 'Customers',
            'description' => 'Customer created, updated or deleted.',
            'setup' => '$/igniterlabs/webhook/webhookevents/customer/setup.md',
        ];
    }

    public static function registerEventListeners()
    {
        return [
            'created' => 'eloquent.created: Admin\Models\Customers_model',
            'updated' => 'eloquent.updated: Admin\Models\Customers_model',
            'deleted' => 'eloquent.deleted: Admin\Models\Customers_model',
        ];
    }

    public static function makePayloadFromEvent(array $args, $actionCode = null)
    {
        $params = [];
        $customer = array_get($args, 0);
        if ($customer instanceof Customers_model)
            $params['customer'] = $customer->toArray();

        return $params;
    }
}

Releases

  1.   Latest release
    v1.1.1

    • Minor improvements and bug fixes
  2. v1.1.0

    • Minor improvements and bug fixes
  3. v1.0.0

    Initial release

  • Version:
    v1.1.1
  • Last Updated:
    1 month ago
  • Published:
    23 Sep 21
  • License:
  • Public repository:

Add your extension to the TastyIgniter Marketplace