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

zelaza's avatar

Spark Bug

Hi.

I think there's a small bug in the 'updateSubscription()' method of the 'subscriptions.js' mixin that's preventing messages thrown in 'IneligibleForPlan::because($message)' from being displayed to the user (I'm running Spark version 3.0.5).

The message that gets displayed when the IneligibleForPlan exception gets thrown is hard-coded to "We were unable to update your subscription. Please contact customer support".

I think the line:

this.planForm.errors.set({plan: ["We were unable to update your subscription. Please contact customer support."]});

needs to be changed to:

this.planForm.errors.set({plan: response.body.plan});

or some similar fix.

Anyone know how to submit this as a real bug report?

0 likes
5 replies
ejdelmonico's avatar

Go ahead and make an issue in github. Make sure you follow the guidelines in the Spark repo. If you feel confident of a necessary change, make a pull request. Personally, the hard coded message doesn't bother me at all and you can easily change it yourself.

zelaza's avatar

Ok, thanks, I'll submit it as an issue. In my opinion it's a really good and important feature to have - if you are going to refuse to downgrade a user's subscription you need to tell them why RIGHT NOW - refusing to downgrade them and giving them a generic "contact support" message is a really (unacceptably) bad user experience. I did change the code myself, but I'd rather have the Spark developers make the change so that all Spark users can benefit from it.

zelaza's avatar

Actually, I can't even find the "Spark repo". I see laravel/spark-installer and laravel/spark-docs... How can I submit an issue? Thanks

clay's avatar

You have to sign in to spark.laravel.com and go to settings and link your github account so that you have access to the repo.

awnage's avatar

I cannot connect to the 5.x repo, but this appears to be fixed in 6.x. For 5.x you need to edit /vendor/laravel/spark/resources/assets/js/mixins/subscriptions.js

if (errors.response.status == 422) {
    this.planForm.errors.set(errors.response.data.errors);
} else {
    this.planForm.errors.set({plan: ["We were unable to update your subscription. Please contact customer support."]});
}

Please or to participate in this conversation.