mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
21 lines
394 B
PHP
21 lines
394 B
PHP
<?php
|
|
|
|
namespace App\Traits;
|
|
|
|
trait RefreshComponentOnBroadcast
|
|
{
|
|
public function getListeners(): array
|
|
{
|
|
return [
|
|
'echo-private:app,Broadcast' => 'refreshComponent',
|
|
'refreshComponent' => '$refresh',
|
|
'$refresh',
|
|
];
|
|
}
|
|
|
|
public function refreshComponent(array $data): void
|
|
{
|
|
$this->emit('refreshComponent');
|
|
}
|
|
}
|