Files
coolify/docs/v5/archive/app/Events/V5RealtimeTestEvent.php.txt
Andras Bacsai 76030a30d4 chore(v5): archive V5 implementation and remove runtime integration
Move V5 source, migrations, UI, scripts, and tests into documentation, then remove V5 routes, models, jobs, configuration, dependencies, and application hooks.
2026-08-15 19:13:30 +02:00

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,
];
}
}