PHP code example of ippanelcom / laravel-sdk

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

    

ippanelcom / laravel-sdk example snippets


'providers' => [
    // ...
    Ippanel\IppanelServiceProvider::class,
],

'aliases' => [
    // ...
    'IPPanel' => Ippanel\Facades\IPPanel::class,
],

use Ippanel\Client;

public function sendSMS(Client $ippanel)
{
    $response = $ippanel->sendWebservice(
        'Your message content', 
        '+981000xxxx', // Sender number
        ['+989123456789', '+989987654321'] // Recipients
    );

    if ($response->isSuccessful()) {
        // Message sent successfully
        $data = $response->getData();
        // Process data...
    } else {
        // Handle error
        $error = $response->getMessage();
    }
}

use Ippanel\Client;

public function sendPattern(Client $ippanel)
{
    $response = $ippanel->sendPattern(
        'pattern-code',  // Your pattern code
        '+981000xxxx',   // Sender number
        '+989123456789', // Recipient
        ['name' => 'John', 'code' => '12345'] // Pattern parameters
    );

    if ($response->isSuccessful()) {
        // Pattern message sent successfully
        $data = $response->getData();
        // Process data...
    } else {
        // Handle error
    }
}

use Ippanel\Client;

public function sendVoiceOTP(Client $ippanel)
{
    $response = $ippanel->sendVOTP(
        12345, // OTP code
        '+989123456789' // Recipient
    );

    if ($response->isSuccessful()) {
        // Voice OTP sent successfully
        $data = $response->getData();
        // Process data...
    } else {
        // Handle error
    }
}
bash
php artisan vendor:publish --provider="Ippanel\IppanelServiceProvider" --tag="config"