coolify/app/Livewire/Sponsorship.php

29 lines
605 B
PHP
Raw Normal View History

<?php
2023-12-07 19:06:32 +01:00
namespace App\Livewire;
use Livewire\Component;
class Sponsorship extends Component
{
2023-12-06 10:25:23 +01:00
public function getListeners()
{
$userId = auth()->user()->id;
2023-12-06 10:25:23 +01:00
return [
"echo-private:custom.{$userId},TestEvent" => 'testEvent',
2023-12-06 10:25:23 +01:00
];
}
public function testEvent($asd)
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
}
public function disable()
{
auth()->user()->update(['is_notification_sponsorship_enabled' => false]);
}
public function render()
{
return view('livewire.sponsorship');
}
}