Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
gilour
/
foundation
/
src
/
Websockets
/
API
:
ReverbAPI.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace Common\Websockets\API; use Illuminate\Support\Collection; class ReverbAPI extends WebsocketProviderAPI { public function getAllChannels(): Collection { $appId = config('broadcasting.connections.reverb.app_id'); $response = $this->makeReverbRequest("apps/$appId/channels"); return collect($response['channels'] ?? []); } public function getActiveUsersInChannel(string $channel): Collection { $appId = config('broadcasting.connections.reverb.app_id'); $response = $this->makeReverbRequest( "apps/$appId/channels/presence-$channel/users", ); return collect($response['users'] ?? []); } protected function makeReverbRequest(string $path) { $scheme = config('broadcasting.connections.reverb.options.scheme'); $host = config('broadcasting.connections.reverb.options.host'); $port = config('broadcasting.connections.reverb.options.port'); return $this->makeRequestWithCaching("$scheme://$host:$port/$path"); } }