Level 73
And why don't you use this instead:
this->validate(request(), [
'date' => 'required|date|after:tomorrow'
]);
As essentially that's what you do. And for the format of the attributes take a look in the docs.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi Guys,
I'm validating date input like so
$today = Carbon::parse(Carbon::now())->addDays(1);
$this->validate(request(), [
'date' => 'required|date|after:' . $today,
]);
The problem is that the validation error lang string displays the date format like this :
2019-09-07 11:39:02
Is there any way to format the error message string for the date output ?
And why don't you use this instead:
this->validate(request(), [
'date' => 'required|date|after:tomorrow'
]);
As essentially that's what you do. And for the format of the attributes take a look in the docs.
Please or to participate in this conversation.