PHP code example of orkhanshukurlu / laravel-msm

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

    

orkhanshukurlu / laravel-msm example snippets


MSM_USERNAME=
MSM_PASSWORD=
MSM_SENDER=
MSM_LOGGING=


MSM::send('+994773339800', 'Hello world !');

// və ya

msm()->send('+994773339800', 'Hello world !');

// və ya

msm('+994773339800', 'Hello world !');



try {
    MSM::send('+994773339800', 'Hello world !');
    
    // SMS uğurla göndərildi
    
} catch (SMSNotSentException $exception) {    
    report($exception->getMessage());
    
    // SMS göndərilərkən xəta baş verdi
}



MSMLog::getByPhone('+994773339800');



MSMLog::getByCode(100);



MSMLog::getByPhone('+994773339800', ['id', 'phone', 'message']);

MSMLog::getByCode(100, ['id', 'phone', 'message', 'response_code']);