2022-11-17 02:15:29 +01:00
|
|
|
<?php
|
|
|
|
|
2023-04-29 21:30:41 +02:00
|
|
|
namespace App\Dashboard\Blocks;
|
2022-11-17 02:15:29 +01:00
|
|
|
|
|
|
|
abstract class Block
|
|
|
|
{
|
2022-11-17 02:18:57 +01:00
|
|
|
/**
|
|
|
|
* @return array<array-key, mixed>
|
|
|
|
*/
|
2022-11-17 02:15:29 +01:00
|
|
|
abstract protected function data(): array;
|
|
|
|
|
|
|
|
abstract protected function title(): string;
|
|
|
|
|
|
|
|
abstract protected function component(): string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array{data: array<array-key, mixed>, title: string, component: string}
|
|
|
|
*/
|
|
|
|
public function render(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'data' => $this->data(),
|
|
|
|
'title' => $this->title(),
|
|
|
|
'component' => $this->component(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|