mirror of
https://github.com/brufdev/many-notes.git
synced 2026-05-18 08:08:42 -05:00
42 lines
901 B
PHP
42 lines
901 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Events;
|
|
|
|
use App\Models\VaultNode;
|
|
use Illuminate\Broadcasting\Channel;
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
final class VaultNodeDeleted implements ShouldBroadcastNow
|
|
{
|
|
use Dispatchable;
|
|
use InteractsWithSockets;
|
|
use SerializesModels;
|
|
|
|
/**
|
|
* Create a new event instance.
|
|
*/
|
|
public function __construct(
|
|
private VaultNode $node
|
|
) {
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Get the channels the event should broadcast on.
|
|
*
|
|
* @return array<int, Channel>
|
|
*/
|
|
public function broadcastOn(): array
|
|
{
|
|
return [
|
|
new PrivateChannel('VaultNode.' . $this->node->id),
|
|
];
|
|
}
|
|
}
|