| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentSupport\App\Services\Widgets; |
| 4 |
|
| 5 |
use FluentSupport\Framework\Support\Arr; |
| 6 |
|
| 7 |
abstract class BaseWidget |
| 8 |
{ |
| 9 |
abstract public function widgetName(): string; |
| 10 |
|
| 11 |
abstract public function widgetData(): array; |
| 12 |
|
| 13 |
public static function widgets(): array |
| 14 |
{ |
| 15 |
$instance = new static(); |
| 16 |
$stats = apply_filters( |
| 17 |
'fluent_support/widgets/' . $instance->widgetName(), |
| 18 |
$instance->widgetData() |
| 19 |
); |
| 20 |
return Arr::wrap($stats); |
| 21 |
} |
| 22 |
} |
| 23 |
|