mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 16:02:34 +00:00
init
This commit is contained in:
20
app/Traits/RefreshComponentOnBroadcast.php
Normal file
20
app/Traits/RefreshComponentOnBroadcast.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user