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

merceloki's avatar

Spark doesnt show all the plans

I'm saving all the plans on the database via a form i created. I retrieve them on the boot method. What's strange is it's only displaying plans i inserted on the database by hand. If it was inserted by the form it doesnt show up.

I already console.log'd the plans[] variable and in fact all the plans are there.

0 likes
4 replies
automica's avatar

@merceloki do you need to check if plan is active? are there any differences in the records you've manually created in the db vs the ones you've added in via form?

merceloki's avatar

All plans are active. They are all of the type 'user'. They really don't have any difference besides price, name and the provider id

some code:


    public function boot()
    {
        parent::boot();

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

        $plansDB = DB::table('plans')->get();      
        
        foreach($plansDB as $plan)
        {
            Spark::Plan()
            ->name($plan->name)
            ->id($plan->id)
            ->provider_id($plan->provider_id)
            ->price($plan->price)
            ->attributes([
                'team_id'=> $plan->team_id
                ]);
                
        }
                
    }

Spark::allPlans output: https://pastebin.com/FSux4234

how its displayed

https://imgur.com/a/pwbUsOu

merceloki's avatar

Found out what it was

The price of the plans that wasnt showing was 0

1 like

Please or to participate in this conversation.