conditionally required validation

This doesn't seem to be working:

    Select::make('time_entry_category_id')
                ->required(fn() => !$this->isRunning)


I also want to be able to conditionally require if a field is visible, and this also doesn't seem to be working:

Select::make('time_entry_category_id')
                ->required(fn() => !$this->isRunning)
->visible(fn() => !$this->isRunning)

I've tried replacing the variables with just hard coded true/false values in case the variable wasn't getting set up right, but that's not working either.
Was this page helpful?