2017 © Pedro Peláez
 

library laravel-webhook-channel

Webhook Notifications driver

image

healthengine/laravel-webhook-channel

Webhook Notifications driver

  • Wednesday, May 2, 2018
  • by jradtilbrook
  • Repository
  • 2 Watchers
  • 0 Stars
  • 91 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 23 Forks
  • 0 Open issues
  • 8 Versions
  • 72 % Grown

The README.md

Warning, (*1)

This package is not maintained., (*2)

Please use laravel-notification-channels/webhook instead., (*3)

Webhook notifications channel for Laravel

Latest Version on Packagist Build Status Total Downloads, (*4)

This package makes it easy to send webhooks using the Laravel 5.5 notification system., (*5)

Contents

Installation

You can install the package via composer:, (*6)

``` bash composer require healthengine/laravel-webhook-channel, (*7)


## Usage Now you can use the channel in your `via()` method inside the notification: ``` 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'); } }

In order to let your Notification know which URL should receive the Webhook data, add the routeNotificationForWebhook method to your Notifiable model., (*8)

This method needs to return the URL where the notification Webhook will receive a POST request., (*9)

public function routeNotificationForWebhook()
{
    return 'http://requestb.in/1234x';
}

Available methods

  • data(''): Accepts a JSON-encodable value for the Webhook body.
  • userAgent(''): Accepts a string value for the Webhook user agent.
  • header($name, $value): Sets additional headers to send with the POST Webhook.

Changelog

Please see CHANGELOG for more information what has changed recently., (*10)

Testing

bash $ composer test, (*11)

Security

If you discover any security related issues, please email m.pociot@gmail.com instead of using the issue tracker., (*12)

Contributing

Please see CONTRIBUTING for details., (*13)

Credits

License

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

The Versions