Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Anotheruser's avatar

Laravel Cashier Stripe Webhook help

Hi

I need to update a number of tables in my db when a invoice.payment_failed webhook is called. I am having issues getting it to work. I have followed the laravel docs and created a class that extends WebhookController like so:

class WebhookController extends Laravel\Cashier\WebhookController {

    public function handleInvoicePaymentFailed($payload)
    {
        return new Response('Webhook Handled', 200);
    }

}

I cant even get the response to display in the stripe dashboard. instead i get 'Test webhook error: 500'

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Whoops! There was an error.</title>

    <style>.cf:before, .cf:after {content: " ";display: table;} .cf:after {clear: both;} .cf {*zoom: 1;}
body {
  font: 14px helvetica, arial, sans-serif;
  color: #2B2B2B;
  background-color: #D4D4D4;
  padding:0;
  margin: 0;
  max-height: 100%;

.......

I have a route

Route::post('webhook/test', 'WebhookController@handleInvoicePaymentFailed');

I have also tried renaming my new controller.

Can anyone see what im missing.

thanks

0 likes
2 replies
Braunson's avatar

Yes this is 1+ years old, but having this issue with PHP 5.6.14. I made sure to run php artisan clear-compilerd; php artisan dump-autoload.

It seems the method_exists() function doesn't recognize my extended method. However if I run before it get_class_methods('WebhookController') it's listed first. Now if I run get_class_methods($this) in the same place, it doesn't show my extended method.

Anyone have any suggestions on how to resolve/fix this? I'm curious if this is PHP version related?

Please or to participate in this conversation.