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

MarathonStudios's avatar

Subscription "name" with Laravel Spark

When subscriptions are created, the subscription table column "name" is always set to "default" for all subscriptions regardless of which plan was selected.

My plans look like this:

Spark::plan('basic', 'basic_id');
Spark::plan('pro', 'pro_id');

I expected the "name" column in the database to be either "basic" or "pro". However the "name" is always "default". Is there a way to make the "name" column represent the plan name as expected?

0 likes
1 reply
rameezisrar's avatar
Level 18

@marathonstudios the 'id' and the 'stripe_plan' is key through which you can differentiate and take decisions based on that. But if you really want to include the plan name than this is what I did.

I created two custom tables 1)plan_categories 2)plans

if you have 'basic' category plan and then you can two plans under 'plans' table ie.e basic_monthly and basic_yearly with the fields including 'name'

 Schema::create('plan_categories', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->timestamps();
        });

 Schema::create('plans', function (Blueprint $table) {
            $table->increments('id');
        $table->string('plan_category_id');
            $table->string('name');
            $table->string('type');
            $table->string('plan_id');
            $table->string('price');
            $table->string('cost_price');
            $table->string('trial_days');
            $table->string('publish');
            $table->timestamps();
        });

In this manner you can manage your Plans from the Admin panel too

Please or to participate in this conversation.