Skip to content

Commit

Permalink
[6.x] Fix channel names when broadcasting via redis (#31261)
Browse files Browse the repository at this point in the history
* Fix channel names when broadcasting via redis

This fixes a regression from #31108

* Style fixes

* Update Broadcaster.php

* Override formatChannels instead of changing its signature

Co-authored-by: Graham Campbell <[email protected]>
  • Loading branch information
2 people authored and taylorotwell committed Jan 28, 2020
1 parent ee574a1 commit d5c1268
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ public function broadcast(array $channels, $event, array $payload = [])
);
}

/**
* @param array $channels
* @return array
*/
protected function formatChannels(array $channels)
{
return array_map(function ($channel) {
return $this->prefix.$channel;
}, parent::formatChannels($channels));
}

/**
* Get the Lua script for broadcasting to multiple channels.
*
Expand Down

0 comments on commit d5c1268

Please sign in to comment.