Show a card in infolist if a particular state is not null
I have a card inside infolist I want that to be hidden when a particular relationship on that model is not null. Please see the attached screenshot
I want to show card when booking is not null
1 Reply
->visible(fn (ModelName $record): bool => filled($record->relationname))
... where ModelName is optionally the name of the model of your Resource, and relationname is probably "booking" in your case.
Related: https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-current-form-record