diff --git a/app/Actions/User/CreateUser.php b/app/Actions/User/CreateUser.php index 299c6de2..5094f2cf 100644 --- a/app/Actions/User/CreateUser.php +++ b/app/Actions/User/CreateUser.php @@ -23,14 +23,11 @@ public static function execute(array $data, array $utmParameters = []): User $user = DB::transaction(function () use ($data, $utmParameters): User { $isInviteRegistration = data_get($data, 'is_invite', false); - $starterPlanId = Plan::where('slug', Slug::Starter)->value('id'); - $trialEndsAt = now()->addDays(config('cashier.trial_days', 7)); - $account = Account::create([ 'name' => data_get($data, 'name')."'s Account", 'billing_email' => data_get($data, 'email'), - 'plan_id' => $starterPlanId, - 'trial_ends_at' => $trialEndsAt, + 'plan_id' => Plan::where('slug', Slug::Starter)->value('id'), + 'trial_ends_at' => now()->addDays(config('cashier.trial_days', 7)), ]); $user = User::create(array_merge([ diff --git a/app/Models/Account.php b/app/Models/Account.php index 79f696d1..57934b19 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -91,10 +91,6 @@ public function isOnTrial(): bool return (bool) $this->subscription(self::SUBSCRIPTION_NAME)?->onTrial(); } - /** - * The end date of whichever trial is currently active (subscription trial - * or generic trial), or null if the account is not on any trial. - */ public function activeTrialEndsAt(): ?CarbonInterface { $subscription = $this->subscription(self::SUBSCRIPTION_NAME);