<?php

namespace App\Providers;

use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;

class BroadcastServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap platform web channels and broadcasting verification paths mapping loops.
     */
    public function boot(): void
    {
        Broadcast::routes(['middleware' => ['api', 'auth:sanctum']]);

        // Authorization logic check layout blocks channel rule validations matrix configurations
        Broadcast::channel('security-alerts-channel', function ($user) {
            // Restrict listener registrations exclusively to responding corporate security agency elements
            return in_array($user->role, ['admin', 'agency']);
        });
    }
}
