# Send mail and a database notification

> via() can return mail and database. The Vue bell reads the database row. It does not read the mailable.

- URL: https://laravel-vuejs.space/laravel-mail-and-database-notification
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs

People searching “Laravel notification mail and database” create a mailable and a notification and send both by hand. One notification can list both channels. The [notifications guide](https://laravel-vuejs.space/laravel-vue-notifications) is the bell. This page is `via()`.

> **TL;DR**
>
> -   via() can return mail and database.
> -   The Vue bell reads the database row.
> -   It does not read the mailable.
> -   Do not `Mail::send` and `notify` with two different texts that can drift.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

```php
public function via(object $notifiable): array
{
    return ['mail', 'database'];
}
```

The database channel needs the notifications table:

```shell
php artisan notifications:table
php artisan migrate
```

`toArray()` is what the bell stores. `toMail()` is the email. Keep the secrets out of both. The Vue page still loads the unread rows the way the notifications guide shows. You do not poll the mailbox.

## What to avoid

> **Gotcha**
>
> Do not `Mail::send` and `notify` with two different texts that can drift. Do not put the HTML of the mail into the database column and render it with `v-html`.

## FAQ

**Q: How do I send mail and a database notification?**

via() can return mail and database. The Vue bell reads the database row. It does not read the mailable.

**Q: What goes wrong with Laravel notification mail and database?**

Many developers create a mailable and a notification and send both by hand. Do not `Mail::send` and `notify` with two different texts that can drift.
