2017 © Pedro Peláez
 

library laravel-webhook-notification

Integrate Webhook notification into Laravel 5.5+

image

oanhnn/laravel-webhook-notification

Integrate Webhook notification into Laravel 5.5+

  • Wednesday, July 18, 2018
  • by oanhnn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Introduction

Latest Version Software License Build Status Coverage Status Total Downloads Requires PHP, (*1)

Easy send Webhook notification in Laravel 5.5+ Application, (*2)

Requirements

  • php >=7.1.3
  • Laravel 5.5+

Installation

Begin by pulling in the package through Composer., (*3)

$ composer require oanhnn/laravel-webhook-notification

Usage

Implement webhook notifiable:, (*4)


class User extends Authenticatable implements WebhookNotifiable { use Notifiable; /** * @return string */ public function getSigningKey(): string { return $this->api_key; } /** * @return string */ public function getWebhookUrl(): string { return $this->webhook_url; } }

In notification class,, (*5)


class ProjectCreated extends Notification { /** * @return array */ public function via($notifiable) { return [WebhookChannel::class]; } /** * @return array|WebhookMessage */ public function toWebhook($notifiable) { return WebhookMessage::create() ->data([ 'payload' => [ 'foo' => 'bar' ] ]) ->userAgent("Custom-User-Agent") ->header('X-Custom', 'Custom-Header'); } }

See more in Laravel document, (*6)

Changelog

See all change logs in CHANGELOG, (*7)

Testing

$ git clone git@github.com/oanhnn/laravel-webhook-notification.git /path
$ cd /path
$ composer install
$ composer phpunit

Contributing

Please see CONTRIBUTING for details., (*8)

Security

If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker., (*9)

Credits

License

This project is released under the MIT License.
Copyright © 2018 Oanh Nguyen., (*10)

The Versions