The PowerSMS Gateway PHP Package allows you to easily send bulk SMS messages using the Power SMS service provided by Banglaphone Limited. This package is compatible with both Laravel and raw PHP applications, making it versatile for various use cases.
You can install this package via Composer:
composer require sagordev/powersms-gateway
For Laravel integration, follow these additional steps:
Publish the package configuration file:
php artisan vendor:publish --provider="Sagordev\PowersmsGateway\Providers\PowerSmsGatewayServiceProvider"
This will publish the configuration file to config/powersms.php
Add your Power SMS API credentials and configure other settings in the config/powersms.php
file:
return [
'user_id' => 'YOUR_USER_ID',
'password' => 'YOUR_PASSWORD',
'url' => '' // You can keep it blank
];
use Sagordev\PowersmsGateway\Facades\PowerSms;
PowerSms::message('This is a test SMS', '01234567890')->send();
// You can also send list of numbers (ex: ['01234567890', '01234567891'])
PowerSms::message('This is test SMS')
->to(['01234567890', '01234567891'])
->send();
PowerSms::message('I am SMS with carbon copy to developer')
->to(['01234567890', '01234567891'])
->cc(['01234567892'])
->send();
PowerSms::send([
'message' => 'Hey, This is another SMS',
'to' => ['01234567890', '01234567891'],
]);
PowerSms::send([
[
'message' => 'Dear Customer, Your invitation code is #3310',
'to' => ['01234567890', '01234567891'],
],
[
'message' => 'Dear Customer, Your invitation code is #0950',
'to' => '01234567892',
]
]);
use Sagordev\PowersmsGateway\PowerSms;
$config = [
'user_id' => 'YOUR_USER_ID',
'password' => 'YOUR_PASSWORD',
'url' => '' // You can keep it blank
];
$sms = new PowerSms($config);
$sms->message('Hello', '01234567890')->send();
// Example 2
$sms->message('I am SMS with carbon copy to developer')
->to(['01234567890', '01234567891'])
->cc(['01234567892'])
->send();
// Please look at the previous examples for more fun
If you encounter any issues or have questions about using this package, please feel free to create an issue on the GitHub repository. I am here to help!
This package is open-sourced software licensed under the MIT License.