Fixes for default create

This commit is contained in:
Benjamin Beganović 2024-04-03 17:19:26 +02:00
parent c532a43e70
commit 43a21dfbb4

View File

@ -11,7 +11,9 @@
namespace App\Factory; namespace App\Factory;
use App\Livewire\BillingPortal\Purchase;
use App\Models\Subscription; use App\Models\Subscription;
use App\Services\Subscription\StepService;
class SubscriptionFactory class SubscriptionFactory
{ {
@ -20,8 +22,8 @@ class SubscriptionFactory
$billing_subscription = new Subscription(); $billing_subscription = new Subscription();
$billing_subscription->company_id = $company_id; $billing_subscription->company_id = $company_id;
$billing_subscription->user_id = $user_id; $billing_subscription->user_id = $user_id;
$billing_subscription->steps = collect(\App\Livewire\BillingPortal\Purchase::defaultSteps()) $billing_subscription->steps = collect(Purchase::defaultSteps())
->pluck('id') ->map(fn($step) => StepService::mapClassNameToString($step))
->implode(','); ->implode(',');
return $billing_subscription; return $billing_subscription;