<?php

namespace App\Services\Shared;

use App\Models\User;
use Illuminate\Support\Facades\Log;

class ThemeService
{
    /**
     * Handle the complex logic of updating a theme.
     * In the future, this could include logging, analytics, 
     * or checking subscription tiers before allowing dark mode.
     */
    public function updateTheme(User $user, string $theme): bool
    {
        Log::info("User {$user->id} changed theme to {$theme}");

        $updated = $user->update([
            'theme' => $theme
        ]);

        return $updated;
    }
}