Laravel SMS allows you to send SMS from your Laravel application using one of 10 sms providers in Nigeria, or your own sms provider.
You can install the package via composer:
composer require djunehor/laravel-sms
The package will automatically register itself, so you can start using it immediately.
In Laravel version 5.4 and older, you have to add the service provider in config/app.php
file manually:
'providers' => [
// ...
Djunehor\Sms\SmsServiceProvider::class,
];
After installing the package, you will have to register it in bootstrap/app.php
file manually:
// Register Service Providers
// ...
$app->register(Djunehor\Sms\SmsServiceProvider::class);
];
SMS_SENDER
BETASMS_USERNAME
BETASMS_PASSWORD
BULK_SMS_NIGERIA_TOKEN
BULK_SMS_NIGERIA_DND
GOLD_SMS_247_USERNAME
GOLD_SMS_247_PASSWORD
MULTITEXTER_USERNAME
MULTITEXTER_PASSWORD
SMART_SMS_TOKEN
XWIRELESS_API_KEY
XWIRELESS_CLIENT_ID
Run:
php artisan vendor:publish --tag=laravel-sms
This will move the migration file, seeder file and config file to your app. You can set your sms details in the config file or via env
- Add the env keys to your
.env
file - Or edit the config/laravel-sms.php file
//using betaSMS
use Djunehor\Sms\BetaSms;`
$sms = new BetaSms();
$sms->text($message)->to(08135087966)->from('MyLaravel')->send();
//SmartSmsSolutions
$send = send_sms(SmartSmsSolution::sms, $message, $to)
- Create a class that extends
Djunehor\Sms\Concrete\Sms
class - Implement the
send()
which makes the request and return bool - (Optional) You can add the provider keys to the config/laravel-sms.php
- Fork this project
- Clone to your repo
- Make your changes and run tests
composer test
- Push and create Pull request