mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
update to livewire 3
This commit is contained in:
30
app/Livewire/LaravelEcho.php
Normal file
30
app/Livewire/LaravelEcho.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
use WireUi\Traits\Actions;
|
||||
|
||||
class LaravelEcho extends Component
|
||||
{
|
||||
use Actions;
|
||||
|
||||
protected $listeners = ['echo:plebchannel,.App\Events\PlebLoggedInEvent' => 'plebLoggedIn'];
|
||||
|
||||
public function plebLoggedIn($data)
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$this->notification()
|
||||
->confirm([
|
||||
'img' => $data['img'],
|
||||
'title' => 'Pleb alert!',
|
||||
'description' => $data['name'].' logged in',
|
||||
'icon' => 'bell',
|
||||
'acceptLabel' => '',
|
||||
'rejectLabel' => '',
|
||||
'iconColor' => 'primary',
|
||||
'timeout' => 60000,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user