Conditional action on view resource page

Hi! I'm trying to create conditional actions on a view resource page. Based on the value of a column. So far I tried using a condition on the visible attribute like this:
->visible(fn ($record) => $record->count > 0),
->visible(fn ($record) => $record->count > 0),
But $record always returns null. Does anyone have a solution? Thanks in advance!
4 Replies
LeandroFerreira
try $this->record
TiBiBa
TiBiBaOP2y ago
$this->record does not seem to be allowed:
LeandroFerreira
->visible(fn (): bool => $this->record->count > 0)
->visible(fn (): bool => $this->record->count > 0)
TiBiBa
TiBiBaOP2y ago
Thank you very much!
Want results from more Discord servers?
Add your server