f2m2 / request-notification-channel
Request Notifications driver
1.0.0
2018-03-18 13:22 UTC
Requires
- php: >=5.6.4
- guzzlehttp/guzzle: ~6.0
- illuminate/notifications: 5.3.*|5.4.*|5.5.*|5.6.*
- illuminate/support: 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*
Requires (Dev)
- mockery/mockery: ^0.9.5
- orchestra/database: 3.3.x-dev|^3.5.0
- orchestra/testbench: 3.3.x-dev|^3.5.0
- phpunit/phpunit: 4.*|~6.0
This package is auto-updated.
Last update: 2024-11-11 04:03:42 UTC
README
Used to send an application/x-www-form-urlencoded POST requests.
Installation
You can install the package via composer:
composer require f2m2/request-notifcation-channel
Usage
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.
public function routeNotificationForRequestNotification() { return 'http://httpbin.org/post'; }