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

secondman's avatar

Upgrading Cashier

I'm having a little trouble wrapping my head around how Cashier works now under version 7.0.

I have an app that's being updated from Laravel 5.1 to 5.3 and everything for Cashier is completely different. The user fields have changed, there's a subscriptions table now.

Most importantly the Billable trait has changed and many methods have either changed or been removed altogether. For instance everSubscribed is gone, and I can't see a way to find out if the user was ever subscribed and may have previous invoices.

I've read through the docs like 10 times now and I'm not getting it.

My app has 5 payment options (or subscriptions) the first being the developer plan which is free and does exist in Stripe as a subscription. This is the default when the user signs up.

Looking at the docs:

$user = User::find(1);

$user->newSubscription('main', 'monthly')->create($creditCardToken);

I'm gathering that monthly is the id of my plan in Stripe, what the hell is main and what is it for? The docs say it's the name of the subscription, and where would that name come from?

I have the details of each plan available in a plans table on my database. Do I use some field under the plan for this variable, or what?

If anyone can maybe point me to a working implementation I can use as an example, or maybe help explain the flow of this a little better I would appreciate it.

@JeffreyWay

It would be great to get a new video on Cashier since it's changed dramatically since your original video.

Thanks all.

0 likes
4 replies
ejdelmonico's avatar
Level 53

I use Spark which works as a wrapper around cashier so I am going out on a limb and saying that main is the local name of your Stripe plan. This is how we write the local plan in Spark:

Spark::plan('Pro', 'yearly-pro')
            ->price(540)
            ->yearly()
            ->features([
                'Feature 1',
                'Feature 2',
                'etc'
            ]);

In this example from Spark, Pro is my local plan name and yearly-pro is my Stripe plan name. I am going to guess Cashier works the same way. Hopefully, this example will point you in the right direction.

secondman's avatar

@ejdelmonico

That makes sense, and I appreciate the answer. There are just so many methods that are gone or changed it's taking forever to rework this.

I appreciate your time.

Damayanti's avatar

I have used spark 8 and i want to upgrade 9 for that need cashier 10 when upgrade cashier 9 to 10 then show error -

Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined method Laravel\Cashier\Cashier::useCurrency()

at E:\xampp\htdocs\iplayproject\app\Providers\SparkServiceProvider.php:56 52| public function booted() 53| { 54| Spark::useStripe(); 55| Spark::collectBillingAddress();

56| \Laravel\Cashier\Cashier::useCurrency('gbp', '£'); 57| Spark::afterLoginRedirectTo('/playlist'); 58| //Spark::promotion('Coupon Code'); 59| Spark::plan('Level 1', 'level-1') 60| //->trialDays(14)

I read doc for upgrade cashier 9 to 10 but not understanding

Damayanti's avatar

@ejdelmonico

Please guide me how to solve this issue

I have used spark 8 and i want to upgrade 9 for that need cashier 10 when upgrade cashier 9 to 10 then show error -

Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined method Laravel\Cashier\Cashier::useCurrency()

at E:\xampp\htdocs\iplayproject\app\Providers\SparkServiceProvider.php:56 52| public function booted() 53| { 54| Spark::useStripe(); 55| Spark::collectBillingAddress();

56| \Laravel\Cashier\Cashier::useCurrency('gbp', '£'); 57| Spark::afterLoginRedirectTo('/playlist'); 58| //Spark::promotion('Coupon Code'); 59| Spark::plan('Level 1', 'level-1') 60| //->trialDays(14)

I read the doc for upgrade cashier 9 to 10 but not understanding

Please or to participate in this conversation.