<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CpvSearchRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'page' => 'nullable|integer',
            'itemsPerPage' => 'nullable|integer|max:150',
            'search' => 'nullable|string',
        ];
    }

    /**
     * Filters to be applied to the input.
     *
     * @return array
     */
    public function filters(): array
    {
        return [
            'search' => 'trim|strip_tags|xss_clean',
        ];
    }
}
