PHP code example of signifly / nova-progressbar-field

1. Go to this page and download the library: Download signifly/nova-progressbar-field library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

signifly / nova-progressbar-field example snippets


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


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

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