Skip to content

A Laravel package providing a facade and notification channel leveraging IFTTT Webhooks

License

Notifications You must be signed in to change notification settings

arimolzer/ifttt-webhook

Repository files navigation

Laravel notification channel for IFTTT VOIP Calls

Latest Version on Packagist Build Status Quality Score Total Downloads

This package is designed to provide a custom Laravel notification channel and facade for webhooks to IFTTT.

Installation

You can install the package via composer:

composer require arimolzer/ifttt-webhook

Usage

A complete example of how to add the IFTTT webhook channel to a notification is below:

use Arimolzer\IftttWebhook\Channels\IftttWebhookChannel;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;

class ContactRequestSubmitted extends Notification
{
    use Queueable;

    public function via($notifiable)
    {
        return [IftttWebhookChannel::class];
    }
    
    public function toIftttWebhookChannel($notifiable) : IftttWebhookChannel
    {
        return (new IftttWebhookChannel)
            ->setKey(env('IFTTT_VOIP_WEBHOOK_KEY'))
            ->setEvent(env('IFTTT_VOIP_WEBHOOK_EVENT'))
            ->setParams(
                $notifiable->param1,
                $notifiable->param2
                $notifiable->param3
            );
    }
}

You can also make an asynchronous webhook call via the IftttWebhook::get() facade. eg.

IftttWebhook::get($message->param1, $message->param2, $message->param3, $message->event, $message->key);

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email ari.molzer@molzertech.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

About

A Laravel package providing a facade and notification channel leveraging IFTTT Webhooks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages