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>
47 lines
972 B
PHP
47 lines
972 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Currency extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'code',
|
|
'symbol',
|
|
'name',
|
|
'decimal_places',
|
|
'exchange_rate',
|
|
'is_base',
|
|
'is_enabled',
|
|
'last_synced_at',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'decimal_places' => 'integer',
|
|
'exchange_rate' => 'decimal:6',
|
|
'is_base' => 'boolean',
|
|
'is_enabled' => 'boolean',
|
|
'last_synced_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function scopeEnabled(Builder $query): Builder
|
|
{
|
|
return $query->where('is_enabled', true);
|
|
}
|
|
|
|
public function scopeBase(Builder $query): Builder
|
|
{
|
|
return $query->where('is_base', true);
|
|
}
|
|
}
|