Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

signifly/nova-progressbar-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nova ProgressBar Field

Latest Version on Packagist Total Downloads License

This package allows you to add progressbar fields to your resources and dashboards in Nova.

It basically takes a field with a decimal value between 0 and 1 and shows it as a percentage progress bar.

It edits like a text field.

index example

detail example

form example

DISCLAIMER:

This package is still work in progress. Feel free to help improve it.


Requirements


Installation

Just run:

composer require Signifly/nova-progressbar-field

After this the setup will be complete and you can use the components listed here.


Basic Usage

// in App\Nova\User
...
use signifly\Nova\Fields\ProgressBar\ProgressBar;
...

/**
 * Get the fields available for the request.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return array
 */
public function fields(Request $request)
{
    return [
        ProgressBar::make('Awesomeness'),
    ];
}

Advanced Options

Custom color

public function cards(Request $request)
{
    return [
        ProgressBar::make('Awesomeness')
            ->options([
                'color' => '#FFEA82',
            ]),
    ];
}

Animate Bar Color A -> B

public function cards(Request $request)
{
    return [
        ProgressBar::make('Awesomeness')
            ->options([
                'fromColor' => '#FFEA82',
                'toColor' => '#40BF55',
                'animateColor' => true,
            ]),
    ];
}

Feel free to come with suggestions for improvements.