Notifications
Learn how to send notifications to Nova users.
Overview
Nova notifications allow you to notify Nova users of events within your application, such as a report being ready to download or of an invoice that needs attention. Nova notifications are displayed within a slide-out menu that can be accessed via the “bell” icon within Nova’s top navigation menu.
Sending Notifications
To send a notification, you simply need to send a NovaNotification
instance to a user’s notify
method. Of course, before getting started, you should ensure that your user model is notifiable.
Nova notifications may be generated via the NovaNotification
class, which provides convenient methods like message
, action
, icon
, and type
. The currently supported notification types include success
, error
, warning
, and info
:
You may also send a Nova notification by including the NovaChannel
in the array of channels returned by a notification’s via
method:
Opening Remote Action URLs in New Tabs
When defining a notification action, the openInNewTab
method may be invoked to instruct Nova to open the given URL in a new browser tab:
Notification Icons
Nova utilizes the free Heroicons icon set by Steve Schoger. Therefore, you may simply specify the name of one of these icons when providing the icon name to the Nova notification’s icon
method.
Disabling Notifications
If you wish to completely disable notifications inside Nova, you can call the withoutNotifications
method from your App/Providers/NovaServiceProvider
:
Enabling Unread Notifications Count
By default, Nova shows a visual indicator when there are unread notifications inside the notification center.
If you would like Nova to show the number of unread notifications, you can call the showUnreadCountInNotificationCenter
method from your App/Providers/NovaServiceProvider
:
Was this page helpful?