<?php

namespace App\Http\Requests\Backoffice;

use Illuminate\Foundation\Http\FormRequest;

class FolderListRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'searchString' => '',
            'folderId' => 'integer|nullable',
            'baseFolder' => 'string|nullable',
            'page' => 'integer|min:1|nullable',
            'perPage' => 'integer|min:1|max:100|nullable',
        ];
    }

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