Download the PHP package elimuswift/sms without Composer
On this page you can find all versions of the php package elimuswift/sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sms
Elimuswift SMS
Introduction
Elimuswift SMS is a package for sending SMS using various SMS providers. This package for Laravel adds the capability to send and receive SMS/MMS messages to mobile phones from your web app. The package supports Africas Talking
Requirements
Laravel 5
- PHP: >= 5.5
- Guzzle >= 6.0
Configuration
Composer
First, add the Simple SMS package to your require
in your composer/json
file:
"require": {
"elimuswift/sms": "~2.0"
}
Next, run the composer update
command. This will install the package into your Laravel application.
Service Provider
Once you have added the package to your composer file, you will need to register the service provider with Laravel.
Aliases
Finally, register the Facade.
API Settings
You must run the following command to save your configuration files to your local app:
php artisan vendor:publish --provider="Elimuswift\SMS\Providers\SmsServiceProvider"
This will copy the configuration files to your config
folder.
Get Started
Africas Talkig
To enable the AfricasTalking driver just change config file to:
Nexmo Driver
This driver sends messages through the Nexmo messaging service. It is very reliable and capable of sending messages to mobile phones worldwide.
Twilio Driver
This driver sends messages through the Twilio messaging service. It is very reliable and capable of sending messages to mobile phones worldwide.
Sending an SMS
With everything set up the right way sending an SMS notification would be as simple as:
Multiple Recipients
Sending to multiple Contacts
Send a Blade View
You can also use a view to send the sms notification, The first parameter is the view file that you would like to use. The second is the data that you wish to pass to the view. The final parameter is a callback that will set all of the options on the message closure.
Driver
The driver method will switch the provider during runtime.
Using Laravel Notifications
The package comes with a notification chanel for sending SMS messages using laravels notification system. To get stated add routeNotificationForSMS()
method in your notifiable. this method should return the notifiables's phone number.
Sending The Notification
Now you can use the channel in your via()
method inside the notification:
You can also send a notification as a blade view.