PHP code example of lifetimesms / gateway

1. Go to this page and download the library: Download lifetimesms/gateway library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lifetimesms / gateway example snippets


Lifetimesms\Gateway\LifetimesmsServiceProvider::class,

'Lifetimesms' =>  Lifetimesms\Gateway\Facades\LifetimesmsFacade::class,

$params = ['to' => '03348090100', 'from' => 'Lifetimesms', 'message' => 'Lifetimesms Testing Laravel Package', 'unicode' => false, 'date' => null, 'time' => null];
$response = Lifetimesms::singleSMS($params);

$params = ['to' => ['0334809000', '03008090100', '03448090100'], 'from' => 'Lifetimesms', 'message' => 'Lifetimesms Testing Laravel Package', 'unicode' => false, 'date' => null, 'time' => null];
$response = Lifetimesms::bulkSMS($params);

$params = ['data' => [['to' => '03348090100', 'message' => 'Hello david! its from lifetimesms'], ['to' => '03008090100', 'message' => 'Hello peter! its from lifetimesms']], 'from' => 'Lifetimesms', 'date' => null, 'time' => null];
$response = Lifetimesms::personalizedSMS($params);

$params = ['to' => ['0334809000', '03008090100', '03448090100'], 'from' => 'Lifetimesms', 'voice_id' => '1', 'date' => null, 'time' => null];
$response = Lifetimesms::voiceSMS($params);

$params = ['message_id' => '44a82f4e3dd9bd7a091c1127'];
$response = Lifetimesms::deliveryStatus($params);

$params = ['title' => 'Sample File For Voice SMS', 'file_path' => 'sample.wav'];
// 'file_path' must be the complete path of the audio file
// Valid extensions are mp3 and wav only
$response = Lifetimesms::createVoiceFromFile($params);

$params = ['title' => 'Sample Text For Voice SMS', 'text' => 'Sample text of voice sms.'];
$response = Lifetimesms::createVoiceFromTextToSpeech($params);

$params = ['voice_id' => '1472'];
$response = Lifetimesms::voiceStatus($params);

$response = Lifetimesms::balanceInquiry();

$params = ['phone_number' => '03008090100'];
$response = Lifetimesms::networkLookup($params);
ssh
php artisan vendor:publish --tag="lifetimesms"