@@ -34,6 +34,13 @@ class StoreReservationRequest extends FormRequest
|
||||
public function after(): array
|
||||
{
|
||||
return [function (Validator $validator): void {
|
||||
$now = now();
|
||||
$nowFormatted = $now->format('d/m/Y \à\s H:i');
|
||||
|
||||
if ($validator->errors()->has('starts_at')) {
|
||||
$validator->errors()->add('starts_at', "A data de início deve ser posterior às {$nowFormatted}.");
|
||||
}
|
||||
|
||||
if ($validator->errors()->hasAny(['starts_at', 'ends_at'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user