gtmassey / alert-card
A Laravel Nova card.
v1.0
2025-06-12 18:56 UTC
Requires
- php: ^7.3|^8.0
README
A simple alert card to display persistent notices and messages on Nova resources or dashboards. Styled for my personal preferences.
Installation
composer require gtmassey/alert-card
Usage
use Gtmassey\AlertCard\Alert; //... public function cards() { return [ Alert::make() ->message('My Message!'); ]; }
Colors
There are four alert styles - primary/info, success, warning and danger.
Alert::make() ->message('some message here') ->info(), //this is the default style, applies when no style is declared Alert::make() ->message('some message here') ->success(), Alert::make() ->message('some message here') ->warning(), Alert::make() ->message('some message here') ->danger(),
The info
style uses whatever color you have defined as your primary color in Nova.
Headers
You can add a header to the card using the heading()
method:
Alert::make() ->heading('My Heading') ->message('some longer message here') ->success(),
Icons
You can add an icon to the card using the icon()
method:
Alert::make() ->heading('My Heading') ->message('some longer message here') ->success() ->icon('check-circle'),
Just pass in the name of the corresponding herocion icon.
The icon color will match the color selected for the card.