Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
This package is possibly abandoned. Please proceed with care.

Installation Instructions

You can install the package via composer:

composer require musa11971/nova-status-card

Readme

Latest version on packagist Total downloads

Display useful status information

This Laravel Nova package allows you to easily display useful status information on your Nova dashboard.

Installation

You can install the package via composer:

composer require musa11971/nova-status-card

Usage

Add the card to your dashboard using NovaServiceProvider.

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    /**
     * Get the cards that should be displayed on the default Nova dashboard.
     *
     * @return array
     */
    protected function cards()
    {
        return [
            NovaStatusCard::make()
                ->title('Server Status')
                ->items([
                    NovaStatusItem::make('Database Usage')
                        ->percentage()
                        ->value(function() {
                            // Calculate value...
                            return 55.43;
                        }),
                        
                    NovaStatusItem::make('Redis Server')
                        ->statusIndicator()
                        ->value(function($value) {
                            // Perform check...
                            return $value->ok();
                        })
                ])
        ];
    }
}

Which produces the following:

Types

There are currently 3 types of status items.

String

NovaStatusItem::make('Department Condition')
    ->string()
    ->value(Department::first()->condition)

Percentage

NovaStatusItem::make('Database Usage')
    ->percentage()
    ->value(function() {
        // Calculate value...
        return 55.43;
    })

Status indicator

NovaStatusItem::make('MySQL Server Status')
    ->statusIndicator()
    ->value(function($value) {
        return $value->ok();
        // or:
        // $value->danger();
        // $value->risky();
        // $value->unknown();
    })

Status indicators also support passing a hint, which will be display as the HTML 'title' attribute. Useful for displaying additional information.

NovaStatusItem::make('MySQL Server Status')
    ->statusIndicator()
    ->value(function($value) {
        return $value->risky()->hint('Server responded slowly.');
    })

Contributing

Pull requests are welcomed.

Security

If you discover any security related issues, please email mussesemou99@gmail.com instead of using the issue tracker.

Credits

Credits go to musa11971 for creating and maintaining the package.

Special thanks

Support me

I am a full-time software engineering student and work on this package in my free time. If you find the package useful, please consider making a donation! Every little bit helps. 💜

License

The MIT License (MIT). Please see License File for more information.

Screenshots

Back to Top
Added 4 years ago
Last updated 4 Years Ago
Version 1.0
Composer
musa11971/nova-status-card
GitHub stars 1
Packagist downloads 137

Favorites

1 user favorited

Rating

N/A
(out of 5)
★★★★★
★★★★
★★★
★★
★
0 ratings

Author

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas