Selects and Nested Relationships

Someone asked this in the fall and I didnt see an answer to it, so going to pretty much use his example as it fits my situation perfectly. "is it possible to show nested relationship data in a select field? Meaning instead of ->relationship('author', 'name') something like ->relationship('author.publisher', 'name') where I'm trying to show the name of the publisher associated with the author?"
5 Replies
gizmojo
gizmojo2y ago
Couldn’t you just wrap it in a Group with the author relationship?
Mark Chaney
Mark ChaneyOP2y ago
@gizmojo i have no idea what you are talking about. What does a group have to do with a single Select with 3 tier relationship info? ah, i figured it out. very interesting workaround.
Mark Chaney
Mark ChaneyOP2y ago
https://filamentphp.com/docs/2.x/forms/layout#saving-data-to-relationships just in case anyone else wants to know. never had to do that before.
Filament
Layout - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
qcol
qcol2y ago
Hi, I also have a problem with this. I want to filter using a third level relational table. I don't know how to build Select in the filter. I don't understand how the quoted piece of documentation for reading data into Select? Can you write something more?
gizmojo
gizmojo2y ago
What do you have so far? Nesting select inside a group using relationships is done by
Group::make()
->relationship('metadata')
->schema([
Select::make()
Group::make()
->relationship('metadata')
->schema([
Select::make()
Want results from more Discord servers?
Add your server