https://github.com/developifynet/telenor-php
Telenor Pakistan SMS API PHP Wrapper
https://github.com/developifynet/telenor-php
Last synced: 11 months ago
JSON representation
Telenor Pakistan SMS API PHP Wrapper
- Host: GitHub
- URL: https://github.com/developifynet/telenor-php
- Owner: developifynet
- License: mit
- Created: 2019-05-08T05:30:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-17T17:49:44.000Z (over 3 years ago)
- Last Synced: 2025-06-18T11:51:56.754Z (12 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 5
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Telenor Pakistan Corporate SMS API Wrapper for PHP
This composer package offers a quick Telenor Corporate SMS setup for your Laravel applications.
## Installation
Begin by pulling in the package through Composer.
```bash
composer require developifynet/telenor-sms-php
```
## Laravel Framework Usage
Within your controllers, you can call Telenor facade and can send quick SMS.
##### For Single Number
```php
use Developifynet\Telenor\Telenor;
public function index()
{
$SMSObj = array(
'username' => '', // Usually this is mobile number
'password' => '', // User your password here
'to' => '923XXXXXXXXX', // You can provide single number as string or an array of numbers
'text' => '', // Message string you want to send to provided number(s)
'mask' => '', // Use a registered mask with Telenor
'test_mode' => '0', // 0 for Production, 1 for Mocking as Test
);
$response = Telenor::SendSMS($SMSObj);
}
```
##### For Multiple Numbers
```php
use Developifynet\Telenor\Telenor;
public function index()
{
$SMSObj = array(
'username' => '', // Usually this is mobile number
'password' => '', // User your password here
'to' => ['923XXXXXXXXX', '923XXXXXXXXX'], // You can provide single number as string or an array of numbers
'text' => '', // Message string you want to send to provided number(s)
'mask' => '', // Use a registered mask with Telenor
'test_mode' => '0', // 0 for Production, 1 for Mocking as Test
);
$response = Telenor::SendSMS($SMSObj);
}
```
## Other Usage
Within your controllers, you can call TelenorSMS Object and can send quick SMS.
##### For Single Number
```php
use \Developifynet\Telenor\TelenorSMS;
public function index()
{
$SMSObj = array(
'username' => '', // Usually this is mobile number
'password' => '', // User your password here
'to' => '923XXXXXXXXX', // You can provide single number as string or an array of numbers
'text' => '', // Message string you want to send to provided number(s)
'mask' => '', // Use a registered mask with Telenor
'test_mode' => '0', // 0 for Production, 1 for Mocking as Test
);
$telenor = new TelenorSMS();
$response = $telenor->SendSMS($SMSObj);
}
```
##### For Multiple Numbers
```php
use \Developifynet\Telenor\TelenorSMS;
public function index()
{
$SMSObj = array(
'username' => '', // Usually this is mobile number
'password' => '', // User your password here
'to' => ['923XXXXXXXXX', '923XXXXXXXXX'], // You can provide single number as string or an array of numbers
'text' => '', // Message string you want to send to provided number(s)
'mask' => '', // Use a registered mask with Telenor
'test_mode' => '0', // 0 for Production, 1 for Mocking as Test
);
$telenor = new TelenorSMS();
$response = $telenor->SendSMS($SMSObj);
}
```
### Note
Provided numbers should start with Country code. A Pakistani number you have to write down as 923XXXXXXXXX