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.
The sku which is redundant on the order items table is working obviously, but the description is not. Thanks π
Solution:Jump to 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([...
3 Replies
Have you tried with a relation manager? Do you think this could work for your use-case :
https://filamentphp.com/docs/2.x/admin/resources/relation-managers
Solution
@pboivin thanks but I already was in the Relation Manager resource.
Luckily I managed to solve in this way:
The
Group
class allows to specify a relationship and really important it has the columnSpan
method to align the Group next to the other fields, otherwise it is full width and it breaks anything!Did any nested field You update.. works?