1. Go to this page and download the library: Download panelis-php/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/ */
namespace App\Webhook;
use Illuminate\Http\Request;
use Panelis\Webhook\Contracts\Webhook;
class PingWebhook implements Webhook
{
public function validate(Request $request): void
{
//
}
public function handle(Request $request): mixed
{
return response()->json([
'message' => 'pong',
]);
}
}