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

waleedviews's avatar

Laravel cashier stripe checkout

I am learning laravel cashier and need some help, i am trying to use checkout of stripe instead of my custom checkout

this is the the code i tried so far, and it's giving me an error Route [home] not defined.

Route::get('/subscription-checkout', function (Request $request) {
    return $request->user()
        ->newSubscription('default', 'price_monthly')
        ->checkout();
});

any help please?

0 likes
3 replies
martinbean's avatar
Level 80

@waleedviews Well the error message is pretty clear? You don’t have a route named home.

You’ll either need to explicitly define what your cancel and success URLs are:

Route::get('/subscription-checkout', function (Request $request) {
    return $request->user()
        ->newSubscription('default', 'price_monthly')
        ->checkout([
            'cancel_url' => url('checkout-cancelled'),
            'success_url' => url('checkout-complete'),
        ]);
});

Or actually create a home route for Stripe to redirect the user back to after a customer has completed their checkout.

1 like
waleedviews's avatar

@martinbean you are right, fixed it, i have change my pricing but it's giving me an error, any help with this please The price parameter should be the ID of a price object, rather than the literal numerical price.

Please or to participate in this conversation.