Pricing - Bill per workspace ($12/mo or $120/yr each); Stripe quantity tracks the workspace count and syncs on workspace create/delete. - 2,500 AI credits per workspace, pooled at the account level; monthly reset on the billing anniversary, annual granted upfront (no rollover). - One social account per network per workspace; remove all count-based limits (workspace/social/member) and the legacy plan tiers (single Workspace plan). Onboarding (cloud only: SELF_HOSTED=false + PostHog) - Replace the /subscribe plan picker with /onboarding persona selection (Creator/Freelancer/Startup/Agency/Small business/Other), saved on the user (users.persona) and mirrored to PostHog, then Stripe Checkout on the monthly price. 8-day trial so Stripe displays 7. Billing screen - Remove the Change Plan dialog (dead with a single plan); add an annual-upgrade banner for monthly subscribers (swapToYearly). - Current-plan card shows the workspace count instead of the plan name. System AI - Brand analyzer / workspace autofill is always allowed and never debits credits (system feature, not the user's usage). Self-hosted (SELF_HOSTED=true) bypasses all billing, credit, limit, network, and onboarding logic.
40 lines
874 B
PHP
40 lines
874 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\Plan\Slug;
|
|
use App\Models\Plan;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Plan>
|
|
*/
|
|
class PlanFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'slug' => fake()->randomElement(Slug::cases()),
|
|
'name' => fake()->word(),
|
|
'stripe_monthly_price_id' => null,
|
|
'stripe_yearly_price_id' => null,
|
|
'monthly_credits_limit' => 2500,
|
|
'sort' => 0,
|
|
'is_archived' => false,
|
|
];
|
|
}
|
|
|
|
public function archived(): static
|
|
{
|
|
return $this->state(fn (array $attributes): array => [
|
|
'is_archived' => true,
|
|
]);
|
|
}
|
|
}
|