2017 © Pedro Peláez
 

library request-notification-channel

Request Notifications driver

image

f2m2/request-notification-channel

Request Notifications driver

  • Sunday, March 18, 2018
  • by f2m2
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel Notification Channel

Used to send an application/x-www-form-urlencoded POST requests.

Installation

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

``` bash composer require f2m2/request-notifcation-channel, (*2)


## Usage ``` php use F2M2\RequestNotification\RequestNotificationChannel; use F2M2\RequestNotification\RequestNotificationMessage; use Illuminate\Notifications\Notification; class MyNotification extends Notification { public function via($notifiable) { return [RequestNotificationChannel::class]; } public function toRequestNotification($notifiable) { return RequestNotificationChannel::create() ->data([ 'data' => [ 'property' => 'value' ] ]) ->userAgent("Custom-User-Agent") ->header('X-Custom', 'Custom-Header'); } }

Add the routeNotificationForRequestNotification method to your Notifiable Model, which should return the URL where the notification will call the request., (*3)

public function routeNotificationForRequestNotification()
{
    return 'http://httpbin.org/post';
}

The Versions