PHP code example of xxc / smsgateway-sender

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

    

xxc / smsgateway-sender example snippets


        xXc\SmsGatewaySender\SmsGatewaySenderServiceProvider::class

    try {
        $smsGatewaySender = new \xXc\SmsGatewaySender();
        $response = $smsGatewaySender
            ->from('')
            ->to('')
            ->message('')
            ->send();
        if ($response->isSent()) {
			//do whatever
        } else {
			//log errors $response->errors
			//return error message
        }
    } catch (\Exception $exception) {
		//log data
		//return error based on the exception message?!
    }

$smsGatewaySender = new \xXc\SmsGatewaySender($customPhoneValidator, $customMessageValidator);
\\or

$smsGatewaySender = new \xXc\SmsGatewaySender();
$smsGatewaySender->setPhoneValidator($customPhoneValidator);
$smsGatewaySender->setMessageValidator($customMessageValidator);

php artisan vendor:publish