<?php

use Illuminate\Support\Facades\Broadcast;

/**
 * Logika otorisasi: 
 * User (Staff/Admin) hanya boleh mendengar channel tenant-nya sendiri.
 */
Broadcast::channel('tenant.{tenantId}', function ($user, $tenantId) {
    return (string) $user->tenant_id === (string) $tenantId;
});
