2023-11-13 13:44:54 +00:00
|
|
|
<?php
|
|
|
|
|
2023-12-07 18:06:32 +00:00
|
|
|
namespace App\Livewire;
|
2023-11-13 13:44:54 +00:00
|
|
|
|
|
|
|
use Livewire\Component;
|
|
|
|
|
2024-02-25 21:08:44 +00:00
|
|
|
class LayoutPopups extends Component
|
2023-11-13 13:44:54 +00:00
|
|
|
{
|
2023-12-06 09:25:23 +00:00
|
|
|
public function getListeners()
|
|
|
|
{
|
2023-12-11 09:23:10 +00:00
|
|
|
$teamId = auth()->user()->currentTeam()->id;
|
2023-12-06 09:25:23 +00:00
|
|
|
return [
|
2023-12-11 09:23:10 +00:00
|
|
|
"echo-private:team.{$teamId},TestEvent" => 'testEvent',
|
2023-12-06 09:25:23 +00:00
|
|
|
];
|
|
|
|
}
|
2023-12-11 09:23:10 +00:00
|
|
|
public function testEvent()
|
2023-12-06 09:25:23 +00:00
|
|
|
{
|
2023-12-07 18:06:32 +00:00
|
|
|
$this->dispatch('success', 'Realtime events configured!');
|
2023-12-06 09:25:23 +00:00
|
|
|
}
|
2023-11-13 13:44:54 +00:00
|
|
|
public function disable()
|
|
|
|
{
|
|
|
|
auth()->user()->update(['is_notification_sponsorship_enabled' => false]);
|
|
|
|
}
|
|
|
|
public function render()
|
|
|
|
{
|
2024-02-25 21:08:44 +00:00
|
|
|
return view('livewire.layout-popups');
|
2023-11-13 13:44:54 +00:00
|
|
|
}
|
|
|
|
}
|