Calculated State Typed property Filament\Forms\Components\Component::$container must not be accessed
In my UserResource class, I'm attempting to populate a toggle based on the soft delete flag on the user table. I have this in my model:
and this in my UserResource form:
I'm getting the error
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
.
Not sure what I'm doing wrong, as doing something similar on another resource worked fine.2 Replies
You can't call state() directly like that. You'd need to do something like ...
And you'll need dehydrated(false) so Filament doesn't try to store anything to your non-existent field. Then of course you'll need to figure out the submission logic.
ok thank you...I opted to just add an is_active flag to the table to simplify things.