> ## Documentation Index
> Fetch the complete documentation index at: https://nova.laravel.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

<Frame>
  <img src="https://mintcdn.com/nova-laravel/ISBJ63muGLVA9l3K/images/notifications.png?fit=max&auto=format&n=ISBJ63muGLVA9l3K&q=85&s=5809b1bd2e07a05cb1d99d7b76a1e238" alt="Notifications" width="696" height="420" data-path="images/notifications.png" />
</Frame>

## 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](https://laravel.com/docs/notifications).

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`:

```php theme={null}
use Laravel\Nova\Notifications\NovaNotification;
use Laravel\Nova\URL;

// ...

$request->user()->notify(
    NovaNotification::make()
        ->message('Your report is ready to download.')
        ->action('Download', URL::remote('https://example.com/report.pdf'))
        ->icon('download')
        ->type('info')
);
```

You may also send a Nova notification by including the `NovaChannel` in the array of channels returned by a notification's `via` method:

```php theme={null}
use Laravel\Nova\Notifications\NovaNotification;
use Laravel\Nova\Notifications\NovaChannel;
use Laravel\Nova\URL;

// ...

/**
 * Get the notification's delivery channels
 * 
 * @param mixed $notifiable
 * @return array
 */
public function via($notifiable)
{
    return [NovaChannel::class];
}

/**
 * Get the nova representation of the notification
 * 
 * @return array
 */
public function toNova()
{
    return (new NovaNotification)
        ->message('Your report is ready to download.')
        ->action('Download', URL::remote('https://example.com/report.pdf'))
        ->icon('download')
        ->type('info');
}
```

#### 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:

```php theme={null}
return (new NovaNotification)
    ->action(
        'Download', URL::remote('https://example.com/report.pdf')
    )->openInNewTab()
```

#### Notification Icons

Nova utilizes the free [Heroicons](https://heroicons.com/) icon set by [Steve Schoger](https://twitter.com/steveschoger). 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`:

```php app/Providers/NovaServiceProvider.php {8} theme={null}
/**
 * Boot any application services.
 */
public function boot(): void
{
    parent::boot();

    Nova::withoutNotificationCenter();
}
```

## 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`:

```php app/Providers/NovaServiceProvider.php {8} theme={null}
/**
 * Boot any application services.
 */
public function boot(): void
{
    parent::boot();

    Nova::showUnreadCountInNotificationCenter();
}
```
