gtmassey/alert-card

A Laravel Nova card.

v1.0 2025-06-12 18:56 UTC

This package is auto-updated.

Last update: 2025-06-12 18:59:19 UTC


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.

Heading screenshot

Headers

You can add a header to the card using the heading() method:

Alert::make()
    ->heading('My Heading')
    ->message('some longer message here')
    ->success(),

Heading screenshot

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.

Heading screenshot