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

simonsheehy's avatar

Fresh Install

Hi! First of all, sorry for my english.

I use install a fresh install of Spark (Version 3.0.5) and I can't registrer any user, I receive an error : this.selectedPlan is null. I see some post with that bug and all the solution don't work for me.

That my check list :

  1. I add these lines in my composer.json "laravel/cashier": "~7.0", "laravel/spark": "~3.0"

  2. I update composer / npm (v6.6) and run my npm install

  3. I set my SparkServiceProvider :

    public function booted() { Spark::useStripe()->noCardUpFront()->teamTrialDays(10); Spark::collectBillingAddress();

     Spark::freeTeamPlan()
         ->features([
             'First', 'Second', 'Third'
         ]);
    
     Spark::teamPlan('Équipe - Mensuel', 'standard_montly')
         ->price(12)
         ->features([
             'First', 'Second', 'Third'
         ]);
    
     Spark::teamPlan('Équipe - Annuel', 'standard_yearly')
         ->price(120)
         ->yearly()
         ->features([
             'First', 'Second', 'Third'
         ]);
    
     Spark::teamPlan('Individuel - Mensuel', 'individual_montly')
         ->price(20)
         ->features([
             'First', 'Second', 'Third'
         ]);
    
     Spark::teamPlan('Individuel - Annuel', 'individual_yearly')
         ->price(200)
         ->yearly()
         ->features([
             'First', 'Second', 'Third'
         ]);
     }
    

After all, if I check the page sources codes, I see the window.Spark = ... "cardUpFront":true but it must be false!

Thanks for your help !

Simon

0 likes
5 replies
ejdelmonico's avatar

Comment out this in SparkServiceProvider:

//        Spark::useStripe()->noCardUpFront()->trialDays(10);

Or, just remove the noCardUpFront() method from the chain.

simonsheehy's avatar

But I want use NoCardUpFront.. I want give a free trial !

simonsheehy's avatar

In addition, if I remove these line, I got this message (javascript)

TypeError: Cannot read property 'price' of null

Thanks

ejdelmonico's avatar

Then, you already have that included in the boot method. having noCardUpFront means that $cardUpFront is false. If you want to explicitly require a card up front then use needsCardUpFront().

    /**
     * Indicates that the application does not require a card up front.
     *
     * @return static
     */
    public static function noCardUpFront()
    {
        static::$cardUpFront = false;

        return new static;
    }

    /**
     * Determine if the application requires a card up front.
     *
     * @return bool
     */
    public static function needsCardUpFront()
    {
        return static::$cardUpFront;
    }

Also, make sure you ran gulp after install.

simonsheehy's avatar

Sorry, it's my error, I include the :

Laravel\Spark\Providers\SparkServiceProvider::class,

But I forgot :

App\Providers\SparkServiceProvider::class,

These two files have the same name and I don't see my mistake!!

Sorry and Thanks a lot for your support !

Simon

Please or to participate in this conversation.