1. Go to this page and download the library: Download bencoderus/laravel-webhook 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/ */
bencoderus / laravel-webhook example snippets
public function data(): array
{
return [
'status' => $this->status,
'amount' => $this->amount,
'currency' => 'USD',
];
}
$transaction = Transaction::first();
$webhook = new PaymentWebhook($transaction);
$webhook->url('https://httpbin.com')->send();