PHP code example of firevel / webhook-gateway-laravel-client
1. Go to this page and download the library: Download firevel/webhook-gateway-laravel-client library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
firevel / webhook-gateway-laravel-client example snippets
Event::listen('billing.invoice.created', function ($invoice) {
PaymentService::payInvoice($invoice);
});
protected $listen = [
'billing.invoice.created' => [
'App\Listeners\InvoiceCreated',
],
];
$event->getData(); // Get event data array.
$event->getData('user.email'); // Get event data using "dot" annotation.
$event->getChannel(); // Get event channel name.
$event->getMeta(); // Get event meta data array.
$event->getMeta('role.id'); // Get meta data using "dot" annotation.
$event->getId(); // Get event id.
$event->getSubscription(); // Get event subscription array.
'invoice.created' => [
'eloquent.created: App/Models/Invoice',
]
/**
* Get the event data array for the model.
*
* @return array
*/
public function toEventArray()
{
return [
// Your code here...
];
}
/**
* Get the event meta data array.
*
* @return array
*/
public function eventMetadata()
{
// Your code here...
}
'user.suspended' => [
'App\Events\UserSuspended'
],
bash
php artisan vendor:publish --provider="Firevel\WebhookGatewayLaravelClient\Providers\WebhookGatewayClientServiceProvider" --tag="config"