class ChannelManager extends Manager implements Dispatcher, Factory (View source)

Properties

protected Application $app The application instance. from Manager
protected array $customCreators The registered custom driver creators. from Manager
protected array $drivers The array of created "drivers". from Manager
protected array $defaultChannels The default channels used to deliver messages.

Methods

void
__construct(Application $app)

Create a new manager instance.

from Manager
string
getDefaultDriver()

Get the default channel driver names.

mixed
driver(string $driver = null)

Get a driver instance.

from Manager
mixed
createDriver(string $driver)

Create a new driver instance.

mixed
callCustomCreator(string $driver)

Call a custom driver creator.

from Manager
$this
extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

from Manager
array
getDrivers()

Get all of the created "drivers".

from Manager
mixed
__call(string $method, array $parameters)

Dynamically call the default driver instance.

from Manager
to(array $notifiables)

Create a new notification for the given notifiable entities.

void
dispatch(mixed $notifiable, mixed $instance, array $channels = [])

Dispatch the given notification instance to the given notifiable.

void
queueNotifications(mixed $instance, array $notifications)

Queue the given notification instances.

void
send(Notification $notification)

Send the given notification.

mixed
channel(string|null $name = null)

Get a channel instance.

createDatabaseDriver()

Create an instance of the database driver.

createMailDriver()

Create an instance of the mail driver.

createNexmoDriver()

Create an instance of the Nexmo driver.

createSlackDriver()

Create an instance of the Slack driver.

array
deliversVia()

Get the default channel driver names.

void
deliverVia(array|string $channels)

Set the default channel driver names.

array
notificationsFromInstance(mixed $notifiable, mixed $notification, array|null $channels = null)

Build a new channel notification from the given object.

Details

void __construct(Application $app)

Create a new manager instance.

Parameters

Application $app

Return Value

void

string getDefaultDriver()

Get the default channel driver names.

Return Value

string

mixed driver(string $driver = null)

Get a driver instance.

Parameters

string $driver

Return Value

mixed

protected mixed createDriver(string $driver)

Create a new driver instance.

Parameters

string $driver

Return Value

mixed

Exceptions

InvalidArgumentException

protected mixed callCustomCreator(string $driver)

Call a custom driver creator.

Parameters

string $driver

Return Value

mixed

$this extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

Parameters

string $driver
Closure $callback

Return Value

$this

array getDrivers()

Get all of the created "drivers".

Return Value

array

mixed __call(string $method, array $parameters)

Dynamically call the default driver instance.

Parameters

string $method
array $parameters

Return Value

mixed

Notification to(array $notifiables)

Create a new notification for the given notifiable entities.

Parameters

array $notifiables

Return Value

Notification

void dispatch(mixed $notifiable, mixed $instance, array $channels = [])

Dispatch the given notification instance to the given notifiable.

Parameters

mixed $notifiable
mixed $instance
array $channels

Return Value

void

protected void queueNotifications(mixed $instance, array $notifications)

Queue the given notification instances.

Parameters

mixed $instance
array $notifications

Return Value

void

void send(Notification $notification)

Send the given notification.

Parameters

Notification $notification

Return Value

void

mixed channel(string|null $name = null)

Get a channel instance.

Parameters

string|null $name

Return Value

mixed

protected DatabaseChannel createDatabaseDriver()

Create an instance of the database driver.

Return Value

DatabaseChannel

protected MailChannel createMailDriver()

Create an instance of the mail driver.

Return Value

MailChannel

protected NexmoSmsChannel createNexmoDriver()

Create an instance of the Nexmo driver.

Return Value

NexmoSmsChannel

protected SlackWebhookChannel createSlackDriver()

Create an instance of the Slack driver.

Return Value

SlackWebhookChannel

array deliversVia()

Get the default channel driver names.

Return Value

array

void deliverVia(array|string $channels)

Set the default channel driver names.

Parameters

array|string $channels

Return Value

void

array notificationsFromInstance(mixed $notifiable, mixed $notification, array|null $channels = null)

Build a new channel notification from the given object.

Parameters

mixed $notifiable
mixed $notification
array|null $channels

Return Value

array