Resolution #2
In the spark/src/Plan.php file I added the variable:
public $userRole;
I then appended:
public function __construct($name, $id, $userRole)
{
$this->id = $id;
$this->name = $name;
$this->userRole = $userRole;
}
and
public function jsonSerialize()
{
return [
'id' => $this->id,
'name' => $this->name,
'userRole' => $this->userRole,
'price' => $this->price,
'trialDays' => $this->trialDays,
'interval' => $this->interval,
'features' => $this->features,
'active' => $this->active,
'attributes' => $this->attributes,
'type' => $this->type,
];
}
In the spark/src/Configuration/ManageAvailablePlans.php file, I appended:
public static function plan($name, $id, $userRole)
{
static::$plans[] = $plan = new Plan($name, $id, $userRole);
return $plan;
}
In the app/Providers/SparkServiceProvider.php file, I made sure to pass three parameters:
Spark::plan('Supplier', 'your_stripe_id_01', 'seller')
->price(29.99)
->trialDays(10)
Spark::plan('Ecommerce User', your_stripe_id_02', 'buyer')
->price(9.99)
->trialDays(10)
In the spark migration: _create_subscriptions_table.php, I added the table:
$table->string('user_role');
I then changed the migration table in mysql so that the batch table for the subscriptions migration was the highest number. I then ran:
php artisan migrate:rollback
php artisan migrate
Everything worked above without error. I believe the next step is to get a better understanding of vue.js and how it is serving data to the blade.php files.
Feedback, please?