mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 10:23:30 +00:00
Move V5 source, migrations, UI, scripts, and tests into documentation, then remove V5 routes, models, jobs, configuration, dependencies, and application hooks.
46 lines
1.0 KiB
Plaintext
46 lines
1.0 KiB
Plaintext
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class V5RealtimeTestEvent implements ShouldBroadcastNow
|
|
{
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
|
public string $sentAt;
|
|
|
|
public function __construct(public int $teamId, public string $message)
|
|
{
|
|
$this->sentAt = now()->toJSON();
|
|
}
|
|
|
|
public function broadcastOn(): array
|
|
{
|
|
return [
|
|
new PrivateChannel("team.{$this->teamId}"),
|
|
];
|
|
}
|
|
|
|
public function broadcastAs(): string
|
|
{
|
|
return 'v5.realtime.test';
|
|
}
|
|
|
|
/**
|
|
* @return array{message: string, teamId: int, sentAt: string}
|
|
*/
|
|
public function broadcastWith(): array
|
|
{
|
|
return [
|
|
'message' => $this->message,
|
|
'teamId' => $this->teamId,
|
|
'sentAt' => $this->sentAt,
|
|
];
|
|
}
|
|
}
|