Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filamentβ€’3y agoβ€’
5 replies
riccardogaleazzi

Nested relation

Hello, I have this structure: the order has multiple order items which are linked to a product table.
Now in my orders list page I see all my orders and when I view one of them I use the repeater to show the ordered products.
Since all the products info are on the products table how do I show them? I tried by calling the relationship name with the dot notation but none it's working.

Repeater::make('b2bOrderItems')
    ->relationship('b2bOrderItems')
    ->schema([
        TextInput::make('sku'),
        TextInput::make('product.description')
Repeater::make('b2bOrderItems')
    ->relationship('b2bOrderItems')
    ->schema([
        TextInput::make('sku'),
        TextInput::make('product.description')


The sku which is redundant on the order items table is working obviously, but the description is not. Thanks πŸ™‚
Solution
@pboivin thanks but I already was in the Relation Manager resource.
Luckily I managed to solve in this way:
Repeater::make('b2bOrderItems')
    ->relationship('b2bOrderItems')
    ->schema([
        TextInput::make('sku'),
        Group::make([
            TextInput::make('description')
        ])->relationship('product')
            ->columnSpan(1)
Repeater::make('b2bOrderItems')
    ->relationship('b2bOrderItems')
    ->schema([
        TextInput::make('sku'),
        Group::make([
            TextInput::make('description')
        ])->relationship('product')
            ->columnSpan(1)

The
Group
Group
class allows to specify a relationship and really important it has the
columnSpan
columnSpan
method to align the Group next to the other fields, otherwise it is full width and it breaks anything!
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel β€’ Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

relationManger nested
FilamentFFilament / β“β”Šhelp
2y ago
Nested relation form
FilamentFFilament / β“β”Šhelp
2y ago
Nested relationships.
FilamentFFilament / β“β”Šhelp
2y ago
Nested relationships
FilamentFFilament / β“β”Šhelp
3y ago