'boolean', 'past_brands' => 'array', 'content_showcase' => 'array', ]; protected static ?self $instance = null; /** Get the singleton profile, creating defaults if needed */ public static function getSingleton(): self { if (self::$instance) { return self::$instance; } self::$instance = static::firstOrCreate([], [ 'owner_name' => config('app.name', 'Cathy Page'), 'bg_color' => '#FFF8F0', 'accent_color' => '#FFB7C5', 'text_color' => '#374151', 'show_prices' => true, ]); return self::$instance; } protected static function booted() { static::saved(fn ($model) => self::$instance = $model); static::deleted(fn () => self::$instance = null); } public function getWhatsappUrlAttribute(): ?string { if (! $this->whatsapp) return null; $number = preg_replace('/[^0-9]/', '', $this->whatsapp); return "https://wa.me/{$number}"; } public function getLogoUrlAttribute(): ?string { return $this->logo_path ? route('files.serve-profile-logo') : null; } }