vito/app/Web/Traits/PageHasWidgets.php
Saeed Vaziry f6bc04763b
2.x
2024-09-27 20:36:03 +02:00

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;
}