I was trying to implement a webhook in laravel.
I have created access token and created webhook endpoint also.
my webhook end point is like,https://www.example.com/gocardless.php
and my route is like,
Route::get('/gocardless.php',
'\App\Http\Controllers\gocardlessController@remote')->name('remote');
Controller code like,
class gocardlessController extends Controller
{
public function remote(Request $request)
{
$token ="token";
$raw_payload = file_get_contents('php://input');
$headers = getallheaders();
$provided_signature = $headers["Webhook-Signature"];
$calculated_signature = hash_hmac("sha256",$raw_payload,$token);
if ($provided_signature == $calculated_signature) {
$payload = json_decode($raw_payload, true);
}
}
}
But when i clik on send test webhook in gocardless account,they are given "405 no method found" as responce.
How i can solve this?