在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):laravel-notification-channels/webhook开源软件地址(OpenSource Url):https://github.com/laravel-notification-channels/webhook开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):Webhook notifications channel for LaravelThis package makes it easy to send webhooks using the Laravel notification system. Supports 5.5+, 6.x, 7.x and 8.x. ContentsInstallationYou can install the package via composer: composer require laravel-notification-channels/webhook UsageNow you can use the channel in your 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');
}
} In order to let your Notification know which URL should receive the Webhook data, add the This method needs to return the URL where the notification Webhook will receive a POST request. public function routeNotificationForWebhook()
{
return 'http://requestb.in/1234x';
} Available methods
ChangelogPlease see CHANGELOG for more information what has changed recently. Testing$ composer test SecurityIf you discover any security related issues, please email [email protected] instead of using the issue tracker. ContributingPlease see CONTRIBUTING for details. CreditsLicenseThe MIT License (MIT). Please see License File for more information. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论