How to set default state of a field conditionally on Edit page

In my filament resource, when i try to edit a specific model, all fields r filled automatically, okay. but id like to also fill a field which is used only for presentational purposes. how can i do it?

this is the field id like to fill:
Forms\Components\Toggle::make('has_users')
    ->live()
    ->dehydrated(false)


i tried things like these, but idk how to make it work, the field's value always remains
false
:
->default(function (string $operation, Payment $record): bool {
    if ($operation === 'create') {
        return true;
    }

    return $record->users()->count() > 0;
})

default only works on Create Pages - https://filamentphp.com/docs/3.x/forms/fields/getting-started#setting-a-default-value
so how to make it work in Edit Pages? any alternatives?
Was this page helpful?