<?php

namespace App\Api\Http\Requests\RequestLeave;

use Illuminate\Foundation\Http\FormRequest;

class RequestLeaveRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'user_id' => 'required',
            'from_date' => 'required|date',
            'to_date' => 'required|date|after_or_equal:from_date',
            'reason' => 'required',
            'charge_assigned_to' => 'nullable',
        ];
    }
}
