Downloads
Stars
Version
This Laravel Nova package allows you to easily display useful status information on your Nova dashboard.
You can install the package via composer:
composer require musa11971/nova-status-card
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:
There are currently 3 types of status items.
NovaStatusItem::make('Department Condition')
->string()
->value(Department::first()->condition)
NovaStatusItem::make('Database Usage')
->percentage()
->value(function() {
// Calculate value...
return 55.43;
})
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.');
})
Pull requests are welcomed.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits go to musa11971 for creating and maintaining the package.
Special thanks
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. 💜
The MIT License (MIT). Please see License File for more information.