Skip to content

[Bug]: rule date within dehydrate function not applied #122

@Abdulmajeed-Jamaan

Description

@Abdulmajeed-Jamaan

What happened?

In following lines, the rule not applied at all:

$component->rule(
'date',
static fn (Flatpickr $component): bool => $component->isMultiplePicker() && ! $component->isRangePicker() && $component->hasDate(),
);

Filament calls the dehydrate after the validation happens:

https://github.com/filamentphp/filament/blob/4b2665d934235f05dc49a9668c2c35c073d42a00/packages/schemas/src/Concerns/HasState.php#L418-L427

How to reproduce the bug

Check if date rule applied or not.

$component->rule(
'date',
static fn (Flatpickr $component): bool => $component->isMultiplePicker() && ! $component->isRangePicker() && $component->hasDate(),
);

Package Version

5

PHP Version

8.3

Laravel Version

12

Which operating systems does with happen with?

macOS

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions