Download the PHP package alhaji-aki/laravel-sms without Composer

On this page you can find all versions of the php package alhaji-aki/laravel-sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-sms

Laravel SMS

Laravel SMS is a package that provides a simple and flexible way to send SMS messages from your Laravel application. It supports multiple SMS providers and allows you to easily switch between them.

Installation

You can install the package via composer by running:

Configuration

After the installation has completed, the package will automatically register itself. Run the following to publish the config file

This will create a sms.php file in your config folder where you can configure your SMS providers and other settings. The config file looks like this

The package comes preconfigured for sms providers like Hellio, Wigal, Slack, Log and array.

Failover Configuration

The failover mechanism allows you to define multiple providers to be used in case the primary provider fails. The configuration array for your application's failover sender should contain an array of senders that reference the order in which configured senders should be chosen for delivery:

Once your failover sender has been defined, you should set this sender as the default sender used by your application by specifying its name as the value of the default configuration key within your application's sms configuration file:

Round Robin Configuration

The roundrobin sender allows you to distribute SMS sending across multiple senders to balance the load. To get started, define a sender within your application's sms configuration file that uses the roundrobin sender. The configuration array for your application's roundrobin sender should contain an array of senders that reference which configured senders should be used for delivery:

Setting the FROM

This package allows you to set the from address of your sms in two ways the global way or per sender.

Using a Global from Address

If your application uses the same "from" address for all of its sms, it can become cumbersome to add it to each sender. Instead, you may specify a global "from" address in your config/sms.php configuration file. This address will be used if no other "from" address is specified when sending the sms:

Using Sender Level from Address

If each sender has their own "from" address, you can specify it in the sender's configuration in the config/sms.php configuration file. This address will be used if no other "from" address is specified when sending the sms:

You can also specify a from address when sending the sms. The from specified when sending the message takes precedence over the from set at the Sender level in the sender's configuration. This also takes precedence over the global from set in the config/sms.php configuration file.

Usage

In a notification class

To use this package in your notifications, in your notifiable model, make sure to include a routeNotificationForSms() method, which returns a phone number. Like below:

Then in your notification class can use the channel sms in your via() method:

The \AlhajiAki\Sms\Notification\Messages\SmsMessage class provides the following method

Using the facade

The package provides an Sms facade which can be used to send sms like below:

If you want to use a different sender to send an sms, you can do so like below:

The send() method of accepts 4 parameters explained below:

Sms and Local Development

When developing an application that sends sms, you probably don't want to actually send messages to live phone numbers. This package provides several ways to "disable" the actual sending of messages during local development.

Log Driver

Instead of sending your messages, the log sender driver will write all messages to your log files for inspection. Typically, this driver would only be used during local development. For more information on configuring your application per environment, check out the configuration documentation.

Slack Driver

Alternatively, you may use the slack driver to send your messages where you may view them. This approach has the benefit of allowing you to actually inspect the final message.

Using a Global to Address

Finally, you may specify a global "to" address by invoking the alwaysTo method offered by the Sms facade. Typically, this method should be called from the boot method of one of your application's service providers:

Events

We dispatch two events while sending sms messages. The SmsMessageSending event is dispatched prior to a message being sent, while the SmsMessageSent event is dispatched after a message has been sent. Remember, these events are dispatched when the sms is being sent, not when it is queued. You may create event listeners for these events within your application:

Custom Senders

You may wish to write your own senders to deliver sms via other services that this package does not support out of the box. To get started, define a class that extends the AlhajiAki\Sms\Senders\SenderInterface class. Then, implement the send() and __toString() methods on your sender:

Once you've defined your custom sender, you may register it via the extend method provided by the Sms facade. Typically, this should be done within the boot method of your application's AppServiceProvider service provider. A $config argument will be passed to the closure provided to the extend method. This argument will contain the configuration array defined for the sender in the application's config/sms.php configuration file:

Once your custom sender has been defined and registered, you may create a sender definition within your application's config/sms.php configuration file that utilizes the new sender:

TODOs

Testing

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-sms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
illuminate/contracts Version ^10.0|^11.0
illuminate/notifications Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0
propaganistas/laravel-phone Version ^5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alhaji-aki/laravel-sms contains the following files

Loading the files please wait ....