<?php

use Illuminate\Support\Facades\Broadcast;

Broadcast::routes(['middleware' => ['agent.anonymous']]);
Broadcast::channel('agent-channel.{guestId}', function ($user, $guestId) {
    if ($user->id == $guestId) {
        \Illuminate\Support\Facades\Log::info("Guest authenticated for agent-channel: " . $guestId);
        return true;
    }

    return false;
});
