F
Filament•3mo ago
LozzaJ

How to access row data in relationship manager

I want to make column visible based on field value but cannot work out what to use? I have tried ->visible(function($record) {... but $record is null Thanks in advance 🙂
6 Replies
Dennis Koch
Dennis Koch•3mo ago
This has been asked numerous times already. It’s not possible because it doesn’t make sense to hide columns per row
LozzaJ
LozzaJ•2mo ago
Maybe I am not explaining correctly - I have a row which may or may not have a related item (seat number) - I am displaying a link on this table row "Change Seat" with a custom link - which I only want to appear if the seat number exists.
LeandroFerreira
LeandroFerreira•2mo ago
->formatStateUsing(fn ($state) => $state ? '<a href="#">Change Seat</a>' : '')
->html()
->formatStateUsing(fn ($state) => $state ? '<a href="#">Change Seat</a>' : '')
->html()
?
Dennis Koch
Dennis Koch•2mo ago
That should be enough ->url(fn ($state) => filled($state) ? 'Your url' : null)
LeandroFerreira
LeandroFerreira•2mo ago
I recommend using formatStateUsing because if you are utilizing the url property, the row value would correspond to the seat_number, rather than the text "Change Seat."
LozzaJ
LozzaJ•2mo ago
Thanks guys, I'll give those a go today
Want results from more Discord servers?
Add your server
More Posts
How to set setting values from DB to use accross the project.vat_rate is a value of set in in the DB, where it is a kind of global setting across all classes in How to use $get() to get data from other section or other stepper ?From filament demo : https://github.com/filamentphp/demo/blob/04c41de3dc711cbcb6b4703d9f64e5b3f9f650Call to a member function associate() on nullI got the error like this when tried to create new item or edit seeded data local.ERROR: Call to a SelectFIlter & AsEnumCollectionI have a model `Caliber`. It has a `casts` like this: ```php public function casts(): array { Unable to add Actions Inside Placeholder content of edit modal form.How can I add an action inside Placehoder inside form widget. Here is how I have used Placeholder: PCorrect way to apply a `withCount()` and `->having()` in a SelectFilter?I have a `Domain` that has many `Sites` and I want to filter by the total number of sites each domaiSend data from edit page to create page on a different resource.Im using Laravel v10 and Filament PHP v3 I have the following models: Client LegacyClient I want tWhere documentation From\Components\Group, and what different From\Components\Grid?I need to group fields without labels, and color the background. Should I use Group or Grid? Will thHow to change colors of action buttons/links?There is resource table I need to customize action buttons/links.How to prefix some routes or pages like ListRecords with '/admin' while others don't have the prefixI want a few routes in my app to have the 'admin' prefix while the others should remain intact. Is t