class MyWidget extends BaseWidget
{
public bool $readyToLoad = false;
public function loadData()
{
$this->readyToLoad = true;
}
protected function getStats(): array
{
if (! $this->readyToLoad) {
return [
Stat::make('Loading', 'Loading...')
];
}
sleep (5);
return [
Stat::make('Loaded Widget', 'Done!'),
];
}
}
class MyWidget extends BaseWidget
{
public bool $readyToLoad = false;
public function loadData()
{
$this->readyToLoad = true;
}
protected function getStats(): array
{
if (! $this->readyToLoad) {
return [
Stat::make('Loading', 'Loading...')
];
}
sleep (5);
return [
Stat::make('Loaded Widget', 'Done!'),
];
}
}