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

smurfiez's avatar

Laravel Spark Action Quota

Let's just say I have 3 plans, bronze, silver,gold with 100,300,500 actions respectively,

How would I go around adding a hook so that when the subscription is renewed, I can reset to the limit.

Or if the plan is changed,change the limit to the new one.

On an unrelated note, is there a way to preselect the option chosen on the registration page? Like register?package=gold to select a subscription

0 likes
2 replies
Brian Kidd's avatar
Level 27

@smurfiez Create a new Stripe controller and extend the base one: \Laravel\Spark\Http\Controllers\Settings\Billing\StripeWebhookController

override the method handleInvoicePaymentSucceeded (or teamInvoicePaymentSucceeded if using team billing) and include the same logic but add your logic to reset the limit.

This controller handles all of the webhooks so find the appropriate method to handle a plan change.

To preselect, add query string plan={plan_id}

smurfiez's avatar

Thanks a lot! That was a big help.

Is it possible to get the previous plan a user was subscribed to? So when I handle the event, I can check what the last plan was and add/subtract the quota as necessary.

If you don't mind, you wouldn't happen to know where to customize the receipt?

I've published cashier's views but all my receipts come up as subscription(1) no matter how many packages I have.

Please or to participate in this conversation.