setup test event
This commit is contained in:
@@ -10,17 +10,6 @@ class Dashboard extends Component
|
||||
{
|
||||
public $projects = [];
|
||||
public $servers = [];
|
||||
public function getListeners()
|
||||
{
|
||||
$teamId = auth()->user()->currentTeam()->id;
|
||||
return [
|
||||
"echo-private:custom.{$teamId},TestEvent" => 'notifyNewOrder',
|
||||
];
|
||||
}
|
||||
public function notifyNewOrder()
|
||||
{
|
||||
$this->emit('success', 'New order received!');
|
||||
}
|
||||
public function mount()
|
||||
{
|
||||
$this->servers = Server::ownedByCurrentTeam()->get();
|
||||
|
||||
@@ -6,6 +6,17 @@ use Livewire\Component;
|
||||
|
||||
class Sponsorship extends Component
|
||||
{
|
||||
public function getListeners()
|
||||
{
|
||||
$teamId = auth()->user()->currentTeam()->id;
|
||||
return [
|
||||
"echo-private:custom.{$teamId},TestEvent" => 'testEvent',
|
||||
];
|
||||
}
|
||||
public function testEvent()
|
||||
{
|
||||
$this->emit('success', 'Realtime events configured!');
|
||||
}
|
||||
public function disable()
|
||||
{
|
||||
auth()->user()->update(['is_notification_sponsorship_enabled' => false]);
|
||||
|
||||
Reference in New Issue
Block a user