Filament table: related resource with traits
I'm trying to use Laravel-Vouchers in Filament PHP. I have two models: User (implements CanRedeemVouchers) and Product (implement HasVoucher). I cannot 'see' the model Voucher as this is part of the package. So I cannot manually add a relation to between Product and Voucher (however this should be covered by the traits).
I created a form where I can add vouchers and assign them to a product. This created an entry in the voucher table:
In a Filament table 'Vouchers' I would like to display the product name.
I was trying as follows:
But this clearly is not the right way. Anyone can provide little help?
1 Reply
Use dot notation, it will eager load the relationship. Assuming here that 'product' is the name of the relationship.