<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use App\Libs\Support\Sanitizer\Traits\SanitizesInput;

class AdminExportContentListRequest extends FormRequest
{
    use SanitizesInput;

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'language' => 'required|regex:/^[a-z]{2}(-[a-z]{2})?$/',
            'content_type' => 'nullable|alpha_dash|max:40'
        ];
    }

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