database notifications conditionally hide mark as unread/read button
I can add those buttons to a notification, but I only want it to be rendered if it is actually needed. If the notification is read. I don't know how I can inject a dependency in the closure, so I can conditionally hide it
4 Replies
I had similar issue when tried to hide markAsRead, have not found solution yet..
Bump up š
->visible(fn($record) => !$record->read_at)
If it's individual notification?
Nah tried it first thing š I get {"error":"An attempt was made to evaluate a closure for [Filament\Notifications\Actions\Action], but [$record] was unresolvable."}