'boolean', 'symbol_first' => 'boolean', ]; protected static function booted(): void { static::addGlobalScope(new CurrentCompanyScope); } public function company(): BelongsTo { return $this->belongsTo(FilamentCompanies::companyModel(), 'company_id'); } public function defaultCurrency(): HasOne { return $this->hasOne(DefaultSetting::class, 'currency_code', 'code'); } public function accounts(): HasMany { return $this->hasMany(Account::class, 'currency_code', 'code'); } public static function getCurrencyCodes(): array { $allCodes = array_keys(Config::get('money')); $storedCodes = static::query() ->pluck('code') ->toArray(); $codes = array_diff($allCodes, $storedCodes); return array_combine($codes, $codes); } public static function getDefaultCurrency(): ?string { $defaultCurrency = self::where('enabled', true) ->first(); return $defaultCurrency->code ?? null; } protected static function newFactory(): Factory { return CurrencyFactory::new(); } }