PHP Class SimpleSoftwareIO\SMS\SMS

Show file Open project: simplesoftwareio/simple-sms Class Usage Examples

Protected Properties

Property Type Description
$container Illuminate\Container\Container The IOC Container.
$driver SimpleSoftwareIO\SMS\Drivers\DriverInterface The Driver Interface instance.
$from string The global from address.
$queue Illuminate\Queue\QueueManager Holds the queue instance.

Public Methods

Method Description
__construct ( SimpleSoftwareIO\SMS\Drivers\DriverInterface $driver ) Creates the SMS instance.
alwaysFrom ( $number ) Sets the number that message should always be sent from.
checkMessages ( array $options = [] ) : array Queries the provider for a list of messages.
driver ( $driver ) Changes the set SMS driver.
getMessage ( $messageId ) : IncomingMessage Gets a message by it's ID.
handleQueuedMessage ( Illuminate\Queue\Jobs\Job $job, array $data ) Handles a queue message.
later ( integer $delay, string $view, array $data, Closure | string $callback, null | string $queue = null ) Queues a message to be sent a later time.
laterOn ( null | string $queue, integer $delay, string $view, array $data, Closure | string $callback ) Queues a message to be sent a later time on a given queue.
queue ( string $view, array $data, Closure | string $callback, null | string $queue = null ) Queues a SMS message.
queueOn ( null | string $queue, string $view, array $data, Closure | string $callback ) Queues a SMS message to a given queue.
receive ( ) : IncomingMessage Receives a SMS via a push request.
send ( string $view, array $data, Closure $callback ) : OutgoingMessage Send a SMS.
setContainer ( Illuminate\Container\Container $container ) Sets the IoC container.
setQueue ( Illuminate\Queue\QueueManager $queue ) Set the queue manager instance.

Protected Methods

Method Description
buildQueueCallable ( Closure | string $callback ) : string Builds the callable for a queue.
createOutgoingMessage ( ) : OutgoingMessage Creates a new Message instance.
getQueuedCallable ( array $data ) : mixed Gets the callable for a queued message.

Method Details

__construct() public method

Creates the SMS instance.
public __construct ( SimpleSoftwareIO\SMS\Drivers\DriverInterface $driver )
$driver SimpleSoftwareIO\SMS\Drivers\DriverInterface

alwaysFrom() public method

Sets the number that message should always be sent from.
public alwaysFrom ( $number )
$number

buildQueueCallable() protected method

Builds the callable for a queue.
protected buildQueueCallable ( Closure | string $callback ) : string
$callback Closure | string The callback to be serialized
return string

checkMessages() public method

Queries the provider for a list of messages.
public checkMessages ( array $options = [] ) : array
$options array The options to pass onto a provider. See each provider for a list of options.
return array Returns an array of IncomingMessage objects.

createOutgoingMessage() protected method

Creates a new Message instance.
protected createOutgoingMessage ( ) : OutgoingMessage
return OutgoingMessage

driver() public method

Changes the set SMS driver.
public driver ( $driver )
$driver

getMessage() public method

Gets a message by it's ID.
public getMessage ( $messageId ) : IncomingMessage
$messageId The requested messageId.
return IncomingMessage

getQueuedCallable() protected method

Gets the callable for a queued message.
protected getQueuedCallable ( array $data ) : mixed
$data array
return mixed

handleQueuedMessage() public method

Handles a queue message.
public handleQueuedMessage ( Illuminate\Queue\Jobs\Job $job, array $data )
$job Illuminate\Queue\Jobs\Job
$data array

later() public method

Queues a message to be sent a later time.
public later ( integer $delay, string $view, array $data, Closure | string $callback, null | string $queue = null )
$delay integer The desired delay in seconds
$view string The desired view.
$data array An array of data to fill the view.
$callback Closure | string The callback to run on the Message class.
$queue null | string The desired queue to push the message to.

laterOn() public method

Queues a message to be sent a later time on a given queue.
public laterOn ( null | string $queue, integer $delay, string $view, array $data, Closure | string $callback )
$queue null | string The desired queue to push the message to.
$delay integer The desired delay in seconds
$view string The desired view.
$data array An array of data to fill the view.
$callback Closure | string The callback to run on the Message class.

queue() public method

Queues a SMS message.
public queue ( string $view, array $data, Closure | string $callback, null | string $queue = null )
$view string The desired view.
$data array An array of data to fill the view.
$callback Closure | string The callback to run on the Message class.
$queue null | string The desired queue to push the message to.

queueOn() public method

Queues a SMS message to a given queue.
public queueOn ( null | string $queue, string $view, array $data, Closure | string $callback )
$queue null | string The desired queue to push the message to.
$view string The desired view.
$data array An array of data to fill the view.
$callback Closure | string The callback to run on the Message class.

receive() public method

Receives a SMS via a push request.
public receive ( ) : IncomingMessage
return IncomingMessage

send() public method

Send a SMS.
public send ( string $view, array $data, Closure $callback ) : OutgoingMessage
$view string The desired view.
$data array The data that needs to be passed into the view.
$callback Closure The methods that you wish to fun on the message.
return OutgoingMessage The outgoing message that was sent.

setContainer() public method

Sets the IoC container.
public setContainer ( Illuminate\Container\Container $container )
$container Illuminate\Container\Container

setQueue() public method

Set the queue manager instance.
public setQueue ( Illuminate\Queue\QueueManager $queue )
$queue Illuminate\Queue\QueueManager

Property Details

$container protected property

The IOC Container.
protected Container,Illuminate\Container $container
return Illuminate\Container\Container

$driver protected property

The Driver Interface instance.
protected DriverInterface,SimpleSoftwareIO\SMS\Drivers $driver
return SimpleSoftwareIO\SMS\Drivers\DriverInterface

$from protected property

The global from address.
protected string $from
return string

$queue protected property

Holds the queue instance.
protected QueueManager,Illuminate\Queue $queue
return Illuminate\Queue\QueueManager