Can I use relationships in a form like this?
I have a table that successfully uses a relationship from another table:
Tables\Columns\TextColumn::make('company.company_name'),
This displays the company name due to the relation setup in the model.
But when I try and replicate this for the form, it doesn't work:
Forms\Components\Select::make('company.company_name')
->required()
How do I get the select drop down to show the company names? (and write the ID back to the database when editing the records)?
3 Replies
Not sure if there's a better solution but I think I've always manually specified the options in my selects, something like this:
Thanks guys! Really appreciate the help here whilst Iβm getting up to speed on Filament. ππ