PHP code example of al-saloul / msegat

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

    

al-saloul / msegat example snippets

bash
php artisan vendor:publish --provider="Alsaloul\Msegat\MsegatServiceProvider"
bash
use Alsaloul\Msegat\Msegat;

$response = Msegat::sendMessage('966123456789', 'Hello, this is a test message!');

if ($response['code'] === '1') {  
    echo "Message sent successfully!";
} else {
    echo "Failed to send message.";
}