1. Go to this page and download the library: Download terpise/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/ */
terpise / laravel-webhook example snippets
Route::get('callback', [WebhookClientController::class, 'verify'])->middleware(VerifyToken::class);
Route::post('callback', [WebhookClientController::class, 'callback'])->middleware(VerifyToken::class);
// verify use callback authentication when registering
// callback method you can get data from webhook
// middleware for checking the authenticity of the callback, use 'verify_token'
public function verify(Request $request)
{
return new Response(['challenge' => $request->get('challenge')]);
}