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