PHP code example of digital-creative / value-widget

1. Go to this page and download the library: Download digital-creative/value-widget 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/ */

    

digital-creative / value-widget example snippets


use DigitalCreative\NovaDashboard\Filters;
use DigitalCreative\ValueWidget\ValueWidget;
use Laravel\Nova\Http\Requests\NovaRequest;

class MyWidget extends ValueWidget
{
    public function configure(NovaRequest $request): void
    {
        $this->icon('<svg></svg> or heroicons name');
        $this->title('My Widget');
        $this->textColor(dark: '#845adf', light: '#845adf');
        $this->backgroundColor('#845adf4f');
    }

    public function value(Filters $filters): mixed
    {
      //
    }
}