F
Filament2mo ago
keiron

->relationship() on form field directly?

I have a relationship field: Select::make('gender') ->options([ 'male' => 'Male', 'female' => 'Female', ]), I tried adding ->relationship('profile') to it but the value of the field was not prefilled. I then read the docs and saw that this works: Group::make() ->relationship('profile') ->schema([ Select::make('gender') ->options([ 'male' => 'Male', 'female' => 'Female', ]), ]), I am just wondering if I would be able to define the relationship on the field directly somehow, rather than having to add Group::make()?
2 Replies

Did you find this page helpful?