<?php

namespace Rvsitebuilder\Wysiwyg\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class DeletedocumentsRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
                 'fileDeleteName' => 'required',
        ];
    }

    public function authorize()
    {
        return $this->user()->isAdmin();
    }

    public function messages()
    {
        //TODO language system
        return [
                'fileDeleteName.required' => __('wysiwyg::blog.validate.deletedocuments.fileDeleteName.required'),
        ];
    }

    public function sanitize()
    {
        //TODO Define santize for model ให้ไปดูเพิ่มที่ https://laravel.com/docs/5.5/helpers#available-methods
        return [
                'fileDeleteName' => 'clean',
        ];
    }
}
