PHP code example of healthengine / laravel-webhook-channel
1. Go to this page and download the library: Download healthengine/laravel-webhook-channel library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
healthengine / laravel-webhook-channel example snippets
public function routeNotificationForWebhook()
{
return 'http://requestb.in/1234x';
}
php
use NotificationChannels\Webhook\WebhookChannel;
use NotificationChannels\Webhook\WebhookMessage;
use Illuminate\Notifications\Notification;
class ProjectCreated extends Notification
{
public function via($notifiable)
{
return [WebhookChannel::class];
}
public function toWebhook($notifiable)
{
return WebhookMessage::create()
->data([
'payload' => [
'webhook' => 'data'
]
])
->userAgent("Custom-User-Agent")
->header('X-Custom', 'Custom-Header');
}
}