mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-22 19:22:19 +00:00
30 lines
598 B
PHP
30 lines
598 B
PHP
<?php
|
|
|
|
namespace App\Web\Traits;
|
|
|
|
use Illuminate\View\ComponentAttributeBag;
|
|
|
|
trait PageHasWidgets
|
|
{
|
|
protected array $extraAttributes = [
|
|
'wire:poll.5s' => '$dispatch(\'$refresh\')',
|
|
];
|
|
|
|
protected function getExtraAttributes(): array
|
|
{
|
|
return $this->extraAttributes;
|
|
}
|
|
|
|
public function getView(): string
|
|
{
|
|
return 'web.components.page';
|
|
}
|
|
|
|
public function getExtraAttributesBag(): ComponentAttributeBag
|
|
{
|
|
return new ComponentAttributeBag($this->getExtraAttributes());
|
|
}
|
|
|
|
abstract public function getWidgets(): array;
|
|
}
|