Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/broadcasting/src/BroadcastPoolProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@

use Hyperf\HttpServer\Contract\RequestInterface;
use Hypervel\Broadcasting\Contracts\Broadcaster;
use Hypervel\Broadcasting\Contracts\HasBroadcastChannel;
use Hypervel\ObjectPool\PoolProxy;

class BroadcastPoolProxy extends PoolProxy implements Broadcaster
{
/**
* Register a channel authenticator.
*/
public function channel(HasBroadcastChannel|string $channel, callable|string $callback, array $options = []): static
{
$this->__call(__FUNCTION__, func_get_args());

return $this;
}

public function auth(RequestInterface $request): mixed
{
return $this->__call(__FUNCTION__, func_get_args());
Expand Down
5 changes: 5 additions & 0 deletions src/broadcasting/src/Contracts/Broadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

interface Broadcaster
{
/**
* Register a channel authenticator.
*/
public function channel(HasBroadcastChannel|string $channel, callable|string $callback, array $options = []): static;

/**
* Authenticate the incoming request for a given channel.
*/
Expand Down
1 change: 1 addition & 0 deletions src/support/src/Facades/Broadcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* @method static \Hypervel\Broadcasting\BroadcastManager removePoolable(string $driver)
* @method static array getPoolables()
* @method static \Hypervel\Broadcasting\BroadcastManager setPoolables(array $poolables)
* @method static \Hypervel\Broadcasting\Contracts\Broadcaster channel(\Hypervel\Broadcasting\Contracts\HasBroadcastChannel|string $channel, callable|string $callback, array $options = [])
* @method static mixed auth(\Hyperf\HttpServer\Contract\RequestInterface $request)
* @method static mixed validAuthenticationResponse(\Hyperf\HttpServer\Contract\RequestInterface $request, mixed $result)
* @method static void broadcast(array $channels, string $event, array $payload = [])
Expand Down