Major additions: - Knowledge base with categories, articles, revisions, and voting - Enhanced ticket system: departments, SLA policies, canned responses, tags, custom fields, satisfaction ratings, internal notes - Multi-currency support with exchange rate sync - Shopping cart and quote system with PDF generation - Affiliate program with referrals, commissions, and payouts - Account credits, credit notes, and debit notes - Staff management with granular role-based permissions - Fraud detection and order risk assessment - ServerHunter SEO integration - Service lifecycle events (suspend/unsuspend/terminate) - Service management panels for VPS, Dedicated, Hosting, and Game servers - Plan lifecycle fields and per-customer overrides - 30+ migrations, 17 factories, 8 feature test suites Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Currency;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/** @extends Factory<Currency> */
|
|
class CurrencyFactory extends Factory
|
|
{
|
|
protected $model = Currency::class;
|
|
|
|
/** @return array<string, mixed> */
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'code' => strtoupper($this->faker->unique()->lexify('???')),
|
|
'symbol' => $this->faker->randomElement(['$', '€', '£', '¥', '₹']),
|
|
'name' => $this->faker->words(2, true),
|
|
'decimal_places' => 2,
|
|
'exchange_rate' => $this->faker->randomFloat(6, 0.5, 2.0),
|
|
'is_base' => false,
|
|
'is_enabled' => true,
|
|
'last_synced_at' => null,
|
|
];
|
|
}
|
|
|
|
public function base(): static
|
|
{
|
|
return $this->state(fn (): array => [
|
|
'code' => 'USD',
|
|
'symbol' => '$',
|
|
'name' => 'US Dollar',
|
|
'exchange_rate' => 1.000000,
|
|
'is_base' => true,
|
|
]);
|
|
}
|
|
|
|
public function disabled(): static
|
|
{
|
|
return $this->state(fn (): array => [
|
|
'is_enabled' => false,
|
|
]);
|
|
}
|
|
}
|