This package is designed to provide a custom Laravel notification channel and facade for webhooks to IFTTT.
You can install the package via composer:
composer require arimolzer/ifttt-webhook
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);
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email ari.molzer@molzertech.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.