Broadcaster

abstract class Broadcaster implements Broadcaster (View source)

Properties

protected array $channels The registered channel authenticators.
protected array $channelOptions The registered channel options.
protected BindingRegistrar $bindingRegistrar The binding registrar instance.

Methods

$this channel(string $channel, callable|string $callback, array $options = [])

Register a channel authenticator.

mixed verifyUserCanAccessChannel(Request $request, string $channel)

Authenticate the incoming request for a given channel.

array extractAuthParameters(string $pattern, string $channel, callable|string $callback)

Extract the parameters from the given pattern and channel.

ReflectionParameter[] extractParameters(callable|string $callback)

Extracts the parameters out of what the user passed to handle the channel authentication.

ReflectionParameter[] extractParametersFromClass(string $callback)

Extracts the parameters out of a class channel's "join" method.

array extractChannelKeys(string $pattern, string $channel)

Extract the channel keys from the incoming channel name.

mixed resolveBinding(string $key, string $value, array $callbackParameters)

Resolve the given parameter binding.

mixed resolveExplicitBindingIfPossible(string $key, mixed $value)

Resolve an explicit parameter binding if applicable.

mixed resolveImplicitBindingIfPossible(string $key, mixed $value, array $callbackParameters)

Resolve an implicit parameter binding if applicable.

bool isImplicitlyBindable(string $key, ReflectionParameter $parameter)

Determine if a given key and parameter is implicitly bindable.

array formatChannels(array $channels)

Format the channel array into an array of strings.

BindingRegistrar binder()

Get the model binding registrar instance.

callable normalizeChannelHandlerToCallable(mixed $callback)

Normalize the given callback into a callable.

mixed retrieveUser(Request $request, string $channel)

Retrieve the authenticated user using the configured guard (if any).

array retrieveChannelOptions(string $channel)

Retrieve options for a certain channel.

bool channelNameMatchesPattern(string $channel, string $pattern)

Check if channel name from request match a pattern from registered channels.

Details

$this channel(string $channel, callable|string $callback, array $options = [])

Register a channel authenticator.

Parameters

string $channel
callable|string $callback
array $options

Return Value

$this

protected mixed verifyUserCanAccessChannel(Request $request, string $channel)

Authenticate the incoming request for a given channel.

Parameters

Request $request
string $channel

Return Value

mixed

Exceptions

AccessDeniedHttpException

protected array extractAuthParameters(string $pattern, string $channel, callable|string $callback)

Extract the parameters from the given pattern and channel.

Parameters

string $pattern
string $channel
callable|string $callback

Return Value

array

protected ReflectionParameter[] extractParameters(callable|string $callback)

Extracts the parameters out of what the user passed to handle the channel authentication.

Parameters

callable|string $callback

Return Value

ReflectionParameter[]

Exceptions

Exception

protected ReflectionParameter[] extractParametersFromClass(string $callback)

Extracts the parameters out of a class channel's "join" method.

Parameters

string $callback

Return Value

ReflectionParameter[]

Exceptions

Exception

protected array extractChannelKeys(string $pattern, string $channel)

Extract the channel keys from the incoming channel name.

Parameters

string $pattern
string $channel

Return Value

array

protected mixed resolveBinding(string $key, string $value, array $callbackParameters)

Resolve the given parameter binding.

Parameters

string $key
string $value
array $callbackParameters

Return Value

mixed

protected mixed resolveExplicitBindingIfPossible(string $key, mixed $value)

Resolve an explicit parameter binding if applicable.

Parameters

string $key
mixed $value

Return Value

mixed

protected mixed resolveImplicitBindingIfPossible(string $key, mixed $value, array $callbackParameters)

Resolve an implicit parameter binding if applicable.

Parameters

string $key
mixed $value
array $callbackParameters

Return Value

mixed

Exceptions

AccessDeniedHttpException

protected bool isImplicitlyBindable(string $key, ReflectionParameter $parameter)

Determine if a given key and parameter is implicitly bindable.

Parameters

string $key
ReflectionParameter $parameter

Return Value

bool

protected array formatChannels(array $channels)

Format the channel array into an array of strings.

Parameters

array $channels

Return Value

array

protected BindingRegistrar binder()

Get the model binding registrar instance.

Return Value

BindingRegistrar

protected callable normalizeChannelHandlerToCallable(mixed $callback)

Normalize the given callback into a callable.

Parameters

mixed $callback

Return Value

callable

protected mixed retrieveUser(Request $request, string $channel)

Retrieve the authenticated user using the configured guard (if any).

Parameters

Request $request
string $channel

Return Value

mixed

protected array retrieveChannelOptions(string $channel)

Retrieve options for a certain channel.

Parameters

string $channel

Return Value

array

protected bool channelNameMatchesPattern(string $channel, string $pattern)

Check if channel name from request match a pattern from registered channels.

Parameters

string $channel
string $pattern

Return Value

bool

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Broadcasting/Broadcasters/Broadcaster.html