<?php

namespace App\Http\Requests;

use Illuminate\Validation\Rule;

class StoreExportMapTemplate extends ExportMapTemplateRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    #[\Override]
    public function rules(): array
    {
        return [
            'title' => ['required', 'string', 'max:255'],
            'type' => ['nullable', 'string', Rule::in(array_keys(config('export_maps.types', [])))],
        ];
    }
}
