From ca13d897a05a055e1222fa1693106bec94ff8414 Mon Sep 17 00:00:00 2001 From: Artem Stepanenko <31134245+stepanenko3@users.noreply.github.com> Date: Tue, 17 May 2022 08:57:34 +0300 Subject: [PATCH] Update README.md --- README.md | 170 ++++++++++++------------------------------------------ 1 file changed, 36 insertions(+), 134 deletions(-) diff --git a/README.md b/README.md index 632918c..f1e6266 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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('

Hello World!

'), // 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 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