FilamentF
Filament6mo ago
Ryuuji

How can i create a custom field that contains other fields?

I want to create a custom field that can contain other Filament Fields (defined on my custom field, not through the schema outside) but i cant seem to make it work, if i try to directly render a TextInput inside of my custom field I get the error of
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization


<div>
    @php
        // Here I really bring the item from the php side.
        $item = \Filament\Forms\Components\TextInput::make('test')
    @endphp
    {{$item}}
</div>


So I guess there is some setup i need to make to support this, but my only reference is the Repeater component that also contains fields but is too complex and I haven't been able to follow the logic
Was this page helpful?