mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-08 01:12:34 +00:00
refactoring
This commit is contained in:
21
app/Http/Livewire/Broadcast.php
Normal file
21
app/Http/Livewire/Broadcast.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Livewire\Component;
|
||||
|
||||
class Broadcast extends Component
|
||||
{
|
||||
public function render(): View
|
||||
{
|
||||
$event = Cache::get('broadcast');
|
||||
if ($event) {
|
||||
Cache::forget('broadcast');
|
||||
$this->emit('broadcast', $event);
|
||||
}
|
||||
|
||||
return view('livewire.broadcast');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user