swooinc/nova-countdown

A countdown card for Laravel Nova.

Installs: 24 351

Dependents: 0

Suggesters: 0

Security: 0

Stars: 13

Watchers: 3

Forks: 4

Open Issues: 1

Language:Vue

v1.0.4 2020-12-10 20:04 UTC

This package is auto-updated.

Last update: 2024-11-10 14:48:19 UTC


README

A countdown card for Laravel Nova.

Installation

Install the package with composer using the following command:

composer require swooinc/nova-countdown

Usage

You can pass a Carbon instance for the countdown.

<?php

namespace App\Nova;

use Swooinc\NovaCountdown\NovaCountdown;

class User extends Resource
{
    // Other methods
    
    /**
     * Get the cards available for the request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function cards(Request $request)
    {
        return [
            (new NovaCountdown)
                ->to(now()->addDays(30))
                ->label('30 Days Later'),
        ];
    }
}

License

The MIT License (MIT). Please see License File for more information.