FilamentF
Filament17mo ago
morty

Infolist table repeater or key-value from a relationship?

Hi,

Is there a way to display a list of key-values from a has many relationship in an infolist? If not, is there a way to display a table of this relationship?

For example, If my infolist was about an Author model, is there an infolist entry I can use to display a list of all the author's books from a related Book model?
Solution
Hmm actually, I managed to get there in the end.

Infolists\Components\RepeatableEntry::make('grades')
    ->hiddenLabel()
    ->contained(false)
    ->schema([
        Infolists\Components\TextEntry::make('name')
            ->hiddenLabel(),
        Infolists\Components\TextEntry::make('value')
            ->hiddenLabel(),
    ])->columns(2),
CleanShot_2024-08-15_at_16.32.36.png
Was this page helpful?