PHP code example of tahamohamed / smsgateway

1. Go to this page and download the library: Download tahamohamed/smsgateway 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/ */

    

tahamohamed / smsgateway example snippets


return [
    /*
    |--------------------------------------------------------------------------
    | hisms App Credentials
    |--------------------------------------------------------------------------
    |
    |
    */
    'hisms' => [
        'username' => env('SMS_HISMS_USERNAME',''),
        'password' => env('SMS_HISMS_PASSWORD',''),
        'sender' => env('SMS_HISMS_SENDER','')
    ],
    /*
    |--------------------------------------------------------------------------
    | netpowers App Credentials
    |--------------------------------------------------------------------------
    |
    |
    */
    'netpowers' => [
        'username' => env('SMS_NETPOWERS_USERNAME',''),
        'password' => env('SMS_NETPOWERS_PASSWORD',''),
        'sender' => env('SMS_NETPOWERS_SENDER','')
    ],
    /*
    |--------------------------------------------------------------------------
    | smsgateway App Credentials
    |--------------------------------------------------------------------------
    |
    |
    */
    'smsgateway' => [
        'username' => env('SMS_SMSGATEWAY_USERNAME',''),
        'password' => env('SMS_SMSGATEWAY_PASSWORD',''),
        'sender' => env('SMS_SMSGATEWAY_SENDER','')
    ],
];

# returns 'gateway config'
$gateway_sms = AppGateway::to(96651111111111)
    // Or NetPowers::to(), Hisms::to()
    // Or Add Multiple Numbers
    ->to([96650000000,96659999999])
    ->addDatetime(['date' => date('Y-m-d'), 'time' => date('H:i')])
    ->addMessage('asd asd asd');

# returns 'response from gateway'
$response = SMSGateway::send($gateway_sms);

# returns 'gateway config'
$gateway_sms = Hisms::changePassword('new_password');
// Or Hisms::forgetPassword();
// Or Hisms::deleteScheduleSMS();
// Or Hisms::getBalance();

# returns 'response from gateway'
$response = SMSGateway::send($gateway_sms);

php artisan vendor:publish --tag=smsgateway.config