mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
2.x
This commit is contained in:
29
app/Web/Traits/PageHasWidgets.php
Normal file
29
app/Web/Traits/PageHasWidgets.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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;
|
||||
}
|
Reference in New Issue
Block a user