<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CitaRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return \Auth::check();
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'titulo' => 'required',
            'detalle' => 'required',
            'fecha' => 'required|date_format:d/m/Y H:i',
            'id_alm' => 'required'
        ];
    }

    public function messages()
    {
        return [
            'detalle.required' => 'El campo detalle esta vacío.',
            'fecha.required' => 'El campo fecha esta vacío'
        ];
    }
}
