📈Widget

you can easy create a widget to show customers count or some counts on your resource by just 1 command

Using

to create a new widget inside your resource class you can use this command

php artisan vilt:widget

It will ask you to input widget name and the resource class name and the module name and it will generate an action class for you like this

class CustomWidget extends Widgets
{

 public function setup(): void
    {
         $this->name("custom");
         $this->label(__('Custom'));
         $this->icon('bx bx-user');
         $this->type('success');
         $this->value(120);
    }

}

set your data and define the widget class on ResourceName/Components.php trait like this

public function components(): array {
  return [
     Component::make(CustomWidget::class)->widget()
  ];
} 

you will get a button in the header of your resource

Last updated