Level 5
Hi, if the user has one subscription you should be able to do something like the following:
$timestamp = $user->asStripeCustomer()['subscriptions']->data[0]['current_period_end'];
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everyone!
I need to retrieve user's next billing/due date for his Stripe subscription. Any ideas how can I do that?
If you have the stripe subscription you want to check, there is method you can call on it to get this information:
$timestamp = $subscription->asStripeSubscription()->current_period_end;
An example of pulling a subscription off a user would look something like this:
$timestamp = Auth::user()->subscription('default')->asStripeSubscription()->current_period_end;
Please or to participate in this conversation.