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

lat4732's avatar
Level 12

How can I retrieve next billing date for subscription (Stripe + Laravel Cashier)

Hello everyone!

I need to retrieve user's next billing/due date for his Stripe subscription. Any ideas how can I do that?

0 likes
3 replies
ellgreen's avatar

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'];
lat4732's avatar
Level 12

@ellgreen Getting the following error:

Attempt to read property "data" on null
ellgreen's avatar
ellgreen
Best Answer
Level 5

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;
3 likes

Please or to participate in this conversation.