PHP code example of dannyvilla / 1s2u-sms

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

    

dannyvilla / 1s2u-sms example snippets


'providers' => [
    /*
     * Package Service Providers...
     */
    Oxanfoxs\OneServiceToYouSMS\Provider\OneServiceToYouSMSServiceProdiver::class,

]

'aliases' => [
    ...
    
    'MessageApi' => Oxanfoxs\OneServiceToYouSMS\Facades\MessageApi::class,

]

     ...

    'username' => 'your-username-here',

     ....

    'password' => 'your-password-here',

$response = MessageApi::setMessage('Hello word')
                      ->setSenderId('SMS')
                      ->setMobileNumbers(['123456789', '234567891'])
                      ->appendNumber('123456678')
                      ->send();

$response = MessageApi::setMessage('Hello word', MessageApi::SIMPLE_TEXT_MESSAGE)
                      ->setSenderId('FROM')
                      ->setMobileNumbers(['1234567890'])
                      ->send();

$response = MessageApi::setMessage('Hello word', MessageApi::UNICODE_MESSAGE)
                      ->setSenderId('FROM')
                      ->setMobileNumbers(['1234567890'])
                      ->send();

$response = MessageApi::setMessage('Hello word')
                      ->setSenderId('FROM')
                      ->setMobileNumbers(['1234567890'])
                      ->shouldFlash(true)
                      ->send();

$response = MessageApi::checkCredit()
bash
php artisan vendor:publish --provider="Oxanfoxs\OneServiceToYouSMS\Provider\OneServiceToYouSMSServiceProdiver"