Overview
Notifications come fully styled out of the box. However, if you want to apply your own styling or use a custom view to render notifications, there are multiple options.Styling notifications
Notifications have dedicated CSS classes you can hook into to apply your own styling. Open the inspector in your browser to find out which classes you need to target.Positioning notifications
You can configure the alignment of the notifications in a service provider or middleware, by callingNotifications::alignment() and Notifications::verticalAlignment(). You can pass Alignment::Start, Alignment::Center, Alignment::End, VerticalAlignment::Start, VerticalAlignment::Center or VerticalAlignment::End:
Using a custom notification view
If your desired customization can’t be achieved using the CSS classes above, you can create a custom view to render the notification. To configure the notification view, call the staticconfigureUsing() method inside a service provider’s boot() method and specify the view to use:
resources/views/filament/notifications/notification.blade.php. The view should use the package’s base notification component for the notification functionality and pass the available $notification variable through the notification attribute. This is the bare minimum required to create your own notification view:
Using a custom notification object
Maybe your notifications require additional functionality that’s not defined in the package’sNotification class. Then you can create your own Notification class, which extends the package’s Notification class. For example, your notification design might need a size property.
Your custom Notification class in app/Notifications/Notification.php might contain:
Notification class into the container inside a service provider’s register() method:
Notification class in the same way as you would with the default Notification object.