<?php

namespace App\Http\Requests\BlogCategory;

use Illuminate\Foundation\Http\FormRequest;

class GetBlogCategoryRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true; // Update based on your authorization logic
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'category_id' => 'nullable|uuid|exists:blog_categories,category_id', // Optional and must exist in blog_categories
        ];
    }

    /**
     * Prepare the data for validation (if needed).
     */
    protected function prepareForValidation(): void
    {
        // You can normalize or preprocess input here if necessary
    }
}
