Files
lash_vanshy/app/Http/Requests/HorarioBloqueadoRequest.php

32 lines
747 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class HorarioBloqueadoRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'fecha' => ['required', 'date'],
'hora_inicio' => ['required', 'date_format:H:i'],
'hora_fin' => ['required', 'date_format:H:i', 'after:hora_inicio'],
'motivo' => ['nullable', 'string', 'max:255'],
'activo' => ['nullable', 'boolean'],
];
}
public function messages(): array
{
return [
'hora_fin.after' => 'La hora de fin debe ser posterior a la hora de inicio.',
];
}
}