<?php

namespace App\Http\Resources\Preferences;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class PreferencesResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'receive_email_notifications' => $this->resource['receive_email_notifications'] ?? false,
            'receive_sms_notifications' => $this->resource['receive_sms_notifications'] ?? false,
            'theme' => $this->resource['theme'] ?? null,
            'language' => $this->resource['language'] ?? null,
            'style_color' => $this->resource['style_color'] ?? null,
            'menu_color' => $this->resource['menu_color'] ?? null,
        ];
    }
}
