<?php

namespace App\Modules\Pilkades\Http\Requests\AdminDesa;

use Illuminate\Foundation\Http\FormRequest;

class UpdateProfilDesaRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->isAdminDesa();
    }

    public function rules(): array
    {
        return [
            'sambutan' => ['nullable', 'string'],
            'meta_title' => ['nullable', 'string', 'max:255'],
            'meta_description' => ['nullable', 'string', 'max:500'],
            'og_image' => ['nullable', 'image', 'max:2048'],
            'maps_embed' => ['nullable', 'string'],
            'maps_lat' => ['nullable', 'numeric', 'between:-90,90'],
            'maps_lng' => ['nullable', 'numeric', 'between:-180,180'],
            'tema_warna' => ['nullable', 'string', 'max:50'],
        ];
    }
}
