id === (int) $id; }); // 🛡️ ROLE BASED CHANNELS (Dynamic) Broadcast::channel('roles.{roleName}', function ($user, $roleName) { if ($user->hasAnyRole(['Developer', 'Administrator'])) { return true; } return $user->hasRole($roleName); }); Broadcast::channel('admin.monitoring', function ($user) { return $user->can('view health and logs'); });