Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

domthomas-dev's avatar

Use MaxDate on Date Field

Hi, I don't arrive to use MaxDate meta on a Date Fields. Could you help me ?

Date::make('Date','perform_at')
    ->nullable()
    ->withMeta([
        'dateFormat' => 'd.m.Y',
        'maxDate' => now()->format('d.m.Y')
    ]),

I try this

0 likes
4 replies
bugsysha's avatar

Why would you care if it does not pass the validation?

judev's avatar

use Carbon class and add more time for your validation like this


Carbon::now('UTC')->addHours(2) //you have many possibilites to do what you want.

Hope this help.

Please or to participate in this conversation.