beyondcode / nova-custom-dashboard-card
A Laravel Nova dashboard card that allows you to build custom dashboards.
Installs: 48 228
Dependents: 0
Suggesters: 0
Security: 0
Stars: 83
Watchers: 3
Forks: 16
Open Issues: 5
Language:Vue
Requires
- php: >=7.1.0
- laravel/nova: *
Requires (Dev)
- orchestra/testbench: ^3.6
- phpunit/phpunit: 7.1
This package is auto-updated.
Last update: 2021-05-08 01:05:41 UTC
README
This package lets you create customizable dashboards for every Nova user.
Installation
You can install the package in to a Laravel app that uses Nova via composer:
composer require beyondcode/nova-custom-dashboard-card
Next up, you must register the card with Nova. This is typically done in the cards
method of the NovaServiceProvider
.
// in app/Providers/NovaServiceProvder.php // ... public function cards() { return [ // ... new \Beyondcode\CustomDashboardCard\CustomDashboard, ]; }
Define available cards
Similar to Nova itself, you can define all cards that should be available for selection in the Add Card
modal.
All these cards follow the same authorization rules as any other Nova card - so you do not need to worry about this.
You can register them in your NovaServiceProvider
// in app/Providers/NovaServiceProvder.php use Beyondcode\CustomDashboardCard\NovaCustomDashboard; public function boot() { parent::boot(); NovaCustomDashboard::cards([ new UsersPerDay, new TotalUsers, new TotalAwesomeUsers, // ... all cards you want to be available ]); }
Define custom card names
If you want to define a custom card name, that will be shown in the modal, pass it to the card as a card-name
meta attribute, like this:
NovaCustomDashboard::cards([ (new LaravelUpdateCard)->withMeta([ 'card-name' => 'Laravel Updates Available' ]), ]);
Usage
Visit your Nova dashboard and click the Add Card
button to add new cards to the customized dashboard. The custom dashboard will be stored in localstorage for every user.
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email marcel@beyondco.de instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.