<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class VehicleContentReviewsRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'provider' => ['required', 'string'],
            'make_id' => ['sometimes', 'nullable', 'integer', 'exists:vehicle_makes,id'],
            'model_id' => ['sometimes', 'nullable', 'integer', 'exists:vehicle_models,id'],
            'per_page' => ['sometimes', 'integer', 'min:1', 'max:100'],
            'page' => ['sometimes', 'integer', 'min:1'],
        ];
    }

    public function messages(): array
    {
        return [
            'provider.required' => 'The provider parameter is required.',
        ];
    }
}
