Replies: 1 comment
-
That is because the default macro to create routes using Route::webhooks('webhook-receiving-url'); creates only a post route. While WhatsApp notifications are POST requests, the verification is a GET request
EDIT: Found a way. Route::
controller(VerificationController::class)
->group(function () {
Route::get('/webhook-receiving-url', 'verification') ->name('verification');
}); And in controller, verify the namespace App\Http\Controllers;
use Illuminate\Http\Request;
class VerificationController extends Controller
{
public function verification(Request $request)
{
if($request['hub_verify_token'] === 'YOUR_SET_STRING_IN_WHATSAPP_DASHBOARD') {
return response($request['hub_challenge'], 200);
} else {
return response('', 403);
}
}
} Mine has been verified: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I tried using it on Whatsapp webhook "The callback URL could not be validated

and in the ngrok Show error "405 methods not allowed"
Beta Was this translation helpful? Give feedback.
All reactions