`evalúate` question

I’m working on creating a Title and Slug functionality like WrodPress, and I’m using TextInput as the base for both. The problem is that I’m putting both fields in together in a Filament\Forms\Components\Component called TitleSlug, I add the components with
$this->childComponents(fn () => [
// title component
// slug component
]);
$this->childComponents(fn () => [
// title component
// slug component
]);
And in order to pass some configurations like Label I create a function on the TitleSlug and evaluate the results with
protected function evaluateForTitle(mixed $value): mixed
{
return $this->evaluate($value, [
'state' => $this->titleInput->getState(),
]);
}
protected function evaluateForTitle(mixed $value): mixed
{
return $this->evaluate($value, [
'state' => $this->titleInput->getState(),
]);
}
This function throws the error Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization, do my question (finally) is: When I should call the evaluate function?, or what are the restrictions to use evaluate?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server