Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanenko3 authored May 17, 2022
1 parent 801066c commit ca13d89
Showing 1 changed file with 36 additions and 134 deletions.
170 changes: 36 additions & 134 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
# Nova Health

# Cards for Laravel Nova

[![Latest Version on Packagist](https://img.shields.io/packagist/v/stepanenko3/nova-cards.svg?style=flat-square)](https://packagist.org/packages/stepanenko3/nova-cards)
[![Total Downloads](https://img.shields.io/packagist/dt/stepanenko3/nova-cards.svg?style=flat-square)](https://packagist.org/packages/stepanenko3/nova-cards)
[![License](https://poser.pugx.org/stepanenko3/nova-cards/license)](https://packagist.org/packages/stepanenko3/nova-cards)

![screenshot of cards](screenshots/cards.png)
![screenshot of cards](screenshots/cards-2.png)

## List of Cards

- BlockchainExchangeCard
- CacheCard
- CountdownCard
- EmbedCard
- EnvironmentCard
- HtmlCard
- LinkableCard
- PercentageCard
- ScheduledJobsCard
- SslCard
- SystemResourcesCard
- VersionsCard
- WorldClockCard
- WeatherCard
- CalendarCard
- NovaReleaseCard
[![Latest Version on Packagist](https://img.shields.io/packagist/v/stepanenko3/nova-health.svg?style=flat-square)](https://packagist.org/packages/stepanenko3/nova-health)
[![Total Downloads](https://img.shields.io/packagist/dt/stepanenko3/nova-health.svg?style=flat-square)](https://packagist.org/packages/stepanenko3/nova-health)
[![License](https://poser.pugx.org/stepanenko3/nova-health/license)](https://packagist.org/packages/stepanenko3/nova-health)

![screenshot of tool](screenshots/tool.png)

## Description

Laravel Nova tool for checking healthy of your Laravel app based on https://github.com/spatie/laravel-health

## Requirements

Expand All @@ -34,129 +17,48 @@

## Installation

You can install the nova tool in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```bash
# Install the package
composer require stepanenko3/nova-cards
composer require stepanenko3/nova-health
```

Register the cards with Nova in the `cards()` method of the your Dashboards class:
Next up, you must register the tool with Nova. This is typically done in the `tools` method of the `NovaServiceProvider`.

```php
// in app/Nova/Dashborads/Cards.php

use Stepanenko3\NovaCards\Cards\BlockchainExchangeCard;
use Stepanenko3\NovaCards\Cards\CacheCard;
use Stepanenko3\NovaCards\Cards\CountdownCard;
use Stepanenko3\NovaCards\Cards\EmbedCard;
use Stepanenko3\NovaCards\Cards\EnvironmentCard;
use Stepanenko3\NovaCards\Cards\HtmlCard;
use Stepanenko3\NovaCards\Cards\LinkableCard;
use Stepanenko3\NovaCards\Cards\PercentageCard;
use Stepanenko3\NovaCards\Cards\ScheduledJobsCard;
use Stepanenko3\NovaCards\Cards\SslCard;
use Stepanenko3\NovaCards\Cards\SystemResourcesCard;
use Stepanenko3\NovaCards\Cards\VersionsCard;
use Stepanenko3\NovaCards\Cards\WorldClockCard;
use Stepanenko3\NovaCards\Cards\WeatherCard;
use Stepanenko3\NovaCards\Cards\CalendarCard;
use Stepanenko3\NovaCards\Cards\NovaReleaseCard;

public function cards()
// in app/Providers/NovaServiceProvder.php

// ...

public function tools()
{
return [
(new WeatherCard)
->pollingTime(60000) // Optional
->startPolling(), // Optional. Auto start polling

(new CalendarCard),

(new LinkableCard)
->title('Docs') // Required
->subtitle('subtitle') // Optional
->url('/') // Required
->target('_blank'), // Default: _self

(new CacheCard),

(new SystemResourcesCard),

(new VersionsCard),

(new ScheduledJobsCard)
->startPolling() // Optional. Auto start polling
->pollingTime(1000)
->width('1/2'),

(new BlockchainExchangeCard)
->width('1/2'),

(new NovaReleaseCard),

(new EnvironmentCard),

(new SslCard)
->domain('snotax.com'), // Required

(new SslCard)
->domain('laravel.com'), // Required

(new HtmlCard)
->width('1/3')
->html('<h1>Hello World!</h1>'), // Required

(new HtmlCard)
->width('1/3')
->markdown('# Hello World!'), // Required

(new HtmlCard)
->width('1/3')
->view('cards.hello', ['name' => 'World']), // Required

(new PercentageCard)
->name('Demo percents') // Optional
->label('$') // Optional
->count(33) // Required
->total(1000) // Required
->percentagePrecision(2), // Default: 2

(new CountdownCard)
->to(now()->addDays(30)) // Required
->title('30 Days Later') // Optional
->label('30 Days Later'), // Optional

(new WorldClockCard())
->timezones([ // Required
'Europe/Kiev',
'Asia/Tehran',
'America/new_york',
'America/los_angeles',
])
->timeFormat('H:i:s') // Optional time format default is: 'H:i:s'
->startPolling() // Optional. Auto start polling
->pollingTime(1000) // Optional
->title(__('World Clock')), // Optional

// A most simple embed
(new EmbedCard)
->url('https://www.youtube.com/embed/WhWc3b3KhnY'), // Required

// A more complex embed of raw <iframe>...</iframe> HTML
(new EmbedCard)
->withoutPadding() // Optional remove padding in card
->url('https://www.youtube.com/embed/WhWc3b3KhnY'), // Required
// ...
new \Stepanenko3\NovaHealth\NovaHealth,
];
}
```

Publish the config file:

``` bash
php artisan vendor:publish --provider="Stepanenko3\NovaHealth\ToolServiceProvider"
```

Add your health checks usgin [spatie/laravel-health docs](https://spatie.be/docs/laravel-health/v1/basic-usage/registering-your-first-check)

## Usage

Open your Dashboard in your Nova app to see the cards.
Click on the `"Health"` menu item in your Nova app to see the tool.

## Configuration

All the configuration is managed from a single configuration file located in `config/nova-health.php`

## Screenshots

![screenshot of cards](screenshots/cards-dark.png)
![screenshot of cards](screenshots/cards-2-dark.png)
![screenshot of cards](screenshots/cards-mobile.png)
![screenshot of tool](screenshots/tool-dark.png)
![screenshot of tool](screenshots/tool-mobile.png)

## Credits

Expand Down

0 comments on commit ca13d89

Please sign in to comment.