nimuli/database/factories/PlanFactory.php

44 lines
1.1 KiB
PHP

<?php
namespace Database\Factories;
use App\Domains\Subscription\Models\Plan;
use Illuminate\Database\Eloquent\Factories\Factory;
class PlanFactory extends Factory
{
protected $model = Plan::class;
public function definition(): array
{
return [
'name' => 'Free',
'tier' => 'free',
'monthly_price_cents' => 0,
'workspace_limit' => 1,
'member_limit' => 1,
'custom_domain_limit' => 0,
'link_limit' => 50,
'click_limit_monthly' => 1000,
'bio_pages_limit' => 1,
'features' => [],
];
}
public function free(): static
{
return $this->state(['tier' => 'free', 'name' => 'Free', 'custom_domain_limit' => 0, 'bio_pages_limit' => 1]);
}
public function pro(): static
{
return $this->state([
'tier' => 'pro',
'name' => 'Pro',
'monthly_price_cents' => 1900,
'custom_domain_limit' => 1,
'bio_pages_limit' => 5,
]);
}
}