// First field
DatePicker::make('contract_start')
->rules([
fn (): Closure => function (string $attribute, $value, Closure $fail) {
if ($condition) {
$fail("Incorrect values passed.");
})
]),
// Second field
DatePicker::make('contract_end')
->rules([
fn (): Closure => function (string $attribute, $value, Closure $fail) {
if ($another_condition) {
$fail("Incorrect values passed.");
})
]),
// First field
DatePicker::make('contract_start')
->rules([
fn (): Closure => function (string $attribute, $value, Closure $fail) {
if ($condition) {
$fail("Incorrect values passed.");
})
]),
// Second field
DatePicker::make('contract_end')
->rules([
fn (): Closure => function (string $attribute, $value, Closure $fail) {
if ($another_condition) {
$fail("Incorrect values passed.");
})
]),