Páginas · Laravilt
Notification Types
Choose between toast messages and persistent database notifications.
The same Notification object can be delivered in two ways.
| Type | Method | Lifetime |
|---|---|---|
| Toast | send() | Flashed to the session and shown once on the next page load |
| Database | sendToDatabase($notifiable) | Stored in the notifications table until the user deletes it |
You can send both from one object:
php
sendToDatabase() returns void, so call send() first or keep a reference as shown above.
Statuses
| Constructor | Status | Default icon |
|---|---|---|
Notification::success() | success | heroicon-o-check-circle |
Notification::danger() | danger | heroicon-o-x-circle |
Notification::warning() | warning | heroicon-o-exclamation-triangle |
Notification::info() | info | heroicon-o-information-circle |
Notification::make() starts a notification with status info and no icon. Set the status yourself with ->status('success')->color('success').