<?php

namespace App\Http\Requests\Admin\Settings;

use Illuminate\Foundation\Http\FormRequest;

class UpdateHomepageRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->can('settings.update_homepage');
    }

    public function rules(): array
    {
        return [
            'hero_image_key' => ['nullable', 'string', 'max:2000'],
            'about_image_key' => ['nullable', 'string', 'max:2000'],
            'gallery_image_keys' => ['nullable', 'array'],
            'gallery_image_keys.*' => ['string', 'max:2000'],
        ];
    }

    public function attributes(): array
    {
        return [
            'hero_image_key' => 'foto hero',
            'about_image_key' => 'foto tentang kami',
            'gallery_image_keys' => 'gambar galeri',
        ];
    }
}
