F
Filamentβ€’10mo ago
Jessy

How can I get the value of a field that is not in the relationship

I have a form and in the form a section with a relationship and I need to make a filed visible based on another that is not in that section .
protected function getFormSchema(): array
{
return [ Forms\Components\Toggle::make('display_hp')
->reactive(),
Forms\Components\Group::make()
->relationship('article')
->schema([ TextInput::make('hp')
->visible(fn($get): bool => $get('display_hp')),
)]
];
}
protected function getFormSchema(): array
{
return [ Forms\Components\Toggle::make('display_hp')
->reactive(),
Forms\Components\Group::make()
->relationship('article')
->schema([ TextInput::make('hp')
->visible(fn($get): bool => $get('display_hp')),
)]
];
}
Solution:
$get('../display_hp')
$get('../../display_hp')
$get('../display_hp')
$get('../../display_hp')
The field is traversal πŸ˜‰...
Jump to solution
1 Reply
Solution
toeknee
toekneeβ€’10mo ago
$get('../display_hp')
$get('../../display_hp')
$get('../display_hp')
$get('../../display_hp')
The field is traversal πŸ˜‰

Did you find this page helpful?