Level 3
Okay, I found the answer to this:
We will be able to achieve this in the resolve closure inside SparkServiceProvider like follows:
public function boot(): void
{
Spark::billable(User::class)->resolve(function (Request $request) {
app('config')->set(
'spark.billables.user.plans',
[
[
'name' => $request()->user()->plan->name,
'short_description' => 'Only 1 user access',
'monthly_id' => 'price_id',
'features' => [
'Single Person Access',
'Monthly Subscription',
'Automatic Renewal',
],
'options' => [
'uk' => true,
'others' => false,
],
],
]
);
return $request->user();
});
}