You’ll need a license for Laravel Spark, and you’ll need to have got it working.
Here is the screen a user is sent to when they are not on a plan. The first plan “Basic” is automatically selected, but the “Selected” label can give the appearance that this is the plan that the user is on, when they are in fact on the Free plan, as indicated by the much smaller (and less noticable) text above.
I have made two changes to fix this:
- No plan is selected by default
- The billing form is hidden until a plan is selected
It’s generally a bad idea to edit the code in the
src/ folder, as this will be overwritten by updates. Instead, Spark provides a method to overwrite default code.
Stop Spark Selecting a Plan
In the file
spark/resources/assets/js/spark-components/settings/subscription/subscribe-PROVIDER.js, add a
ready() method. Replace
PROVIDER with your payment provider, either
Hide the payment form by default
In the file
resources/views/vendor/spark/settings/subscription/subscribe-PROVIDER.blade.php, add a
That’s it! Now, when a user goes to the page (and is not subscribed already), the first plan will not be selected by default.
Why doesn’t this break the ‘Edit Subscription’ page?
The js file is specifically for the ‘Create Subscription’ page, and will only be run if the user is not subscribed. If they are already subscribed, the plan they are on will be selected by default.
How can I do this on the register page?
There’s an answer on the laracasts forums.