File: /home/xedaptot/ai.naniguide.com/database/factories/PlanQuotaFactory.php
<?php
namespace Database\Factories;
use App\Model\Plan;
use App\Model\PlanQuota;
use App\Services\Plans\Quotas\QuotaKey;
use Illuminate\Database\Eloquent\Factories\Factory;
class PlanQuotaFactory extends Factory
{
protected $model = PlanQuota::class;
public function definition(): array
{
return [
'plan_id' => Plan::factory(),
'quota_key' => QuotaKey::MAX_CONTACTS->value,
'limit_value' => 1000,
];
}
public function forKey(QuotaKey $key): static
{
return $this->state(['quota_key' => $key->value]);
}
public function unlimited(): static
{
return $this->state(['limit_value' => null]);
}
}