omakei/laravel-nextsms is a Laravel package for a laravel package to send sms using nextsms api .
It currently has 5 GitHub stars and 38 downloads on Packagist (latest version 2.0.0).
Install it with composer require omakei/laravel-nextsms.
Discover more Laravel packages by omakei
or browse all Laravel packages to compare alternatives.
Last updated
Laravel package to send SMS using NextSMS API.
You can install the package via composer:
composer require omakei/laravel-nextsms
You can publish the config file with:
php artisan vendor:publish --tag="nextsms-config"
The following keys must be available in your .env file:
NEXTSMS_USERNAME=
NEXTSMS_PASSWORD=
NEXTSMS_SENDER_ID=
This is the contents of the published config file:
return [
'username' => env('NEXTSMS_USERNAME', 'NEXTSMS'),
'password' => env('NEXTSMS_PASSWORD', 'NEXTSMS'),
'api_key' => base64_encode(env('NEXTSMS_USERNAME', 'NEXTSMS').':'.env('NEXTSMS_PASSWORD', 'NEXTSMS')),
'sender_id' => env('NEXTSMS_SENDER_ID', 'NEXTSMS'),
'url' => [
'sms' => [
'single' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/text/single',
'multiple' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/text/multi',
'reports' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/reports',
'logs' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/logs',
'balance' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/balance',
],
'sub_customer' => [
'create' => NextSMS::NEXTSMS_BASE_URL.'/api/reseller/v1/sub_customer/create',
'recharge' => NextSMS::NEXTSMS_BASE_URL.'/api/reseller/v1/sub_customer/recharge',
'deduct' => NextSMS::NEXTSMS_BASE_URL.'/api/reseller/v1/sub_customer/deduct',
]
],
];
Sending single sms to single destination:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::sendSingleSMS(['to' => '255625933171', 'text' => 'Dj Omakei is texting.']);
Sending single sms to multiple destinations:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::sendSingleSMSToMultipleDestination([
'to' => ['255625933171','255656699895'],
'text' => 'Dj Omakei is texting.']);
Sending multiple sms to multiple destinations (Example 1):
use Omakei\NextSMS\NextSMS;
$response = NextSMS::sendMultipleSMSToMultipleDestinations(['messages' => [
['to' => '255625933171', 'text' => 'Dj Omakei is texting.'],
['to' => '255656699895', 'text' => 'Dj Omakei is texting.']
]]);
Sending multiple sms to multiple destinations (Example 2):
use Omakei\NextSMS\NextSMS;
$response = NextSMS::sendMultipleSMSToMultipleDestinations(['messages' => [
['to' => ['255625933171','255656699895'], 'text' => 'Dj Omakei is texting.'],
['to' => '255625933171', 'text' => 'Dj Omakei is texting.']
]]);
Schedule sms:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::scheduleSMS([
'to' => '255625933171',
'text' => 'Dj Omakei is texting.',
'date' => '2022-01-25' ,
'time' => '12:00']);
Get all delivery reports:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::getAllDeliveryReports();
Get delivery reports with messageId:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::getDeliveryReportWithMessageId(243452542526627);
Get delivery reports with messageId:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::getDeliveryReportWithSpecificDateRange('2022-01-25', '2022-01-29');
Get all sent SMS logs:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::getAllSentSMSLogs(10, 5);
Get all sent SMS logs with the optional parameter:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::getAllSentSMSLogsWithOptionalParameter('255625933171','2022-01-25', '2022-01-29',10, 5);
Register Sub Customer:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::subCustomerCreate(
'Michael',
'Omakei',
'omakei',
'[email protected]',
'06259313171',
'Sub Customer (Reseller)',
100);
Recharge customer:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::subCustomerRecharge('[email protected]', 100);
Deduct a customer:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::subCustomerDeduct('[email protected]', 100);
Get sms balance:
use Omakei\NextSMS\NextSMS;
$response = NextSMS::getSMSBalance();
Please see NextSMS Developer API for more details.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.