mrad
734
7
Spark

Always free plan (no trial), but with possibility to subscribe to paid plans

Posted 2 years ago by mrad

I have the following in booted() in SparkServiceProvider.php


    public function booted()
    {

        Spark::freeTeamPlan()
            ->features([
                'First feature', 'Second feature', 'Third feature', 'Fourth feature'
            ]);

        Spark::teamPlan('Bronce', 'provider-id-1')
            ->price(10)
            ->features([
                'First feature', 'Second feature', 'Third feature', 'Forth feature'
            ]);

        Spark::teamPlan('Silver', 'provider-id-2')
            ->price(25)
            ->features([
                'First feature', 'Second feature', 'Third feature', 'Forth feature'
            ]);

        Spark::teamPlan('Gold', 'provider-id-3')
            ->price(50)
            ->features([
                'First feature', 'Second feature', 'Third feature', 'Forth feature'
            ]);
    }

then the user will have the possibility to register for either the free or one of the paid plans. If he chooses the free plan, he can not upgrade to a paid plan in the future

If instead I have the following:

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

        Spark::freeTeamPlan()
            ->features([
                'First feature', 'Second feature', 'Third feature', 'Fourth feature'
            ]);

        Spark::teamPlan('Bronce', 'provider-id-1')
            ->price(10)
            ->features([
                'First feature', 'Second feature', 'Third feature', 'Forth feature'
            ]);

        Spark::teamPlan('Silver', 'provider-id-2')
            ->price(25)
            ->features([
                'First feature', 'Second feature', 'Third feature', 'Forth feature'
            ]);

        Spark::teamPlan('Gold', 'provider-id-3')
            ->price(50)
            ->features([
                'First feature', 'Second feature', 'Third feature', 'Forth feature'
            ]);
    }

then the free plan is only for 10 days.

But if I want to have a free plan for always and the possibility to upgrade to a paid plan, what will I have to code?

Please sign in or create an account to participate in this conversation.