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

arbenitmsl's avatar

Laravel nova date selection restriction

Hello guys i need to add a rule so that the project end date does not predate the start date

public function fields(NovaRequest $request) { return [ ID::make()->sortable(),

        Text::make('Project Name', 'name')
        ->required(),

        Text::make('Description','description'),

        Date::make('Project Start Date','start_date')
        ->rules('required'),

        Date::make('Project End Date','end_date')
        ->rules('required'),  // this should not be able to predate start_date

    ];
}
0 likes
0 replies

Please or to participate in this conversation.