PHP code example of tonci14 / laravel-eurosms

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

    

tonci14 / laravel-eurosms example snippets


return [
    'url'            => env('EURO_SMS_URL', 'https://as.eurosms.com/sms/Sender'),
    'integrationKey' => env('EUROSMS_KEY', null),
    'integrationID'  => env('EUROSMS_ID', null),
    'senderName'     => env('SMS_SENDER_NAME', null),

    // Povolené krajiny podľa kódu ISO (2-písmenový) napr: 'SK', 'CZ', 'AT'
    'allowed_countries' => [],
];

use EuroSms;

EuroSms::send('+421900123456', 'Ahoj, toto je testovacia správa.');

EuroSms::sendAsync(
    '+421900123456',
    'Toto ide cez queue',
    locale: null,
    queue: 'messaging',
    userId: auth()->id()
);

EuroSms::send('0900123456', 'Test');
// ➜ Invalid phone number format

EuroSms::send('+441234567890', 'UK test');
// ➜ Phone number region 'GB' is not allowed
bash
php artisan vendor:publish --provider="Tonci14\LaravelEuroSMS\LaravelEuroSMSServiceProvider" --tag=eurosms-config
php artisan migrate
bash
php artisan vendor:publish --tag=eurosms-migrations
php artisan vendor:publish --tag=eurosms-config

php artisan migrate
bash
php artisan test