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

umairparacha's avatar

How can i fire an event when the stripe subscription is renewed?

I am using Laravel Cashier (Stripe).

I have a requirement that whenever a subscription is renewed, I want to send an email to the user and also create a transaction for internal analytics.

I have searched the web and found out that the customer.subscription.updated webhook is sent when the subscription is renewed.

I am using a custom WebHookController that extends the default Laravel cashier stripe WebHookController.

I'm not sure, how can I write the logic to trigger an event so that I can do all the side effects required when a subscription is renewed.

Thanks for reading.

0 likes
2 replies
geowrgetudor's avatar

Use this https://github.com/spatie/laravel-stripe-webhooks

  1. Create a new stripe webhook endpoint and add the subscription event you need ( check stripe docs for that )
  2. Make sure you define another env variable for the package's signing_secret config value and add the webhook's secret to that (it won't work if you use 1 webhook for both cashier and spatie's webhook package)
  3. Create a new listener and listen for your specific event. Ex:
'stripe-webhooks::invoice.payment_succeeded' => [
            HandlePaymentSuccessful::class,
],

Please or to participate in this conversation.