->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
you can add relationship to the select