FilamentF
Filament12mo ago
sohail

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
->actions([
  Action::make('markAsRead')
      ->button()
      ->markAsRead(),
  Action::make('markAsUnread')
      ->button()
      ->markAsUnread(),
])
Was this page helpful?