Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beyondcode/nova-custom-dashboard-card
A Laravel Nova dashboard card that allows you to build custom dashboards.
https://github.com/beyondcode/nova-custom-dashboard-card
card laravel nova
Last synced: about 2 months ago
JSON representation
A Laravel Nova dashboard card that allows you to build custom dashboards.
- Host: GitHub
- URL: https://github.com/beyondcode/nova-custom-dashboard-card
- Owner: beyondcode
- License: mit
- Archived: true
- Created: 2018-08-22T14:46:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-18T10:22:49.000Z (about 6 years ago)
- Last Synced: 2024-05-09T14:09:55.310Z (8 months ago)
- Topics: card, laravel, nova
- Language: Vue
- Size: 300 KB
- Stars: 86
- Watchers: 5
- Forks: 22
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Nova Custom Dashboard Card
[![Latest Version on Packagist](https://img.shields.io/packagist/v/beyondcode/nova-custom-dashboard-card.svg?style=flat-square)](https://packagist.org/packages/beyondcode/nova-custom-dashboard-card)
[![Total Downloads](https://img.shields.io/packagist/dt/beyondcode/nova-custom-dashboard-card.svg?style=flat-square)](https://packagist.org/packages/beyondcode/nova-custom-dashboard-card)This package lets you create customizable dashboards for every Nova user.
![screenshot](https://beyondco.de/github/nova-custom-dashboard-card/demo.gif)
## Installation
You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:
```bash
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`.
```php
// 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`
```php
// in app/Providers/NovaServiceProvder.phpuse 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:
```php
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
``` bash
composer test
```### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.