PHP code example of shabayek / laravel-sms

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

    

shabayek / laravel-sms example snippets


'default' => 'smseg',

namespace Shabayek\Sms\Contracts;

class CustomSms implements SmsGatewayContract
{
    public function send($phone, $message): array;

    public function sendOtp($phone, $message = null);

    public function verify(string $phone, int $otp, $actualOtp = null): bool;

    public function balance() { }
}

'connections' => [
    ...
    'custom' => [
        'driver' => 'custom',
        'username' => 'username',
        'password' => 'password',
        'sender_id' => 'sender',
        'service' => 'normal',
    ],
    ...
],


Sms::extend('custom', function ($app) {
    return new CustomSms(config());
});
 bash
php artisan vendor:publish --provider="Shabayek\Sms\SmsServiceProvider"
 php
SMS_CONNECTION=smseg
SMS_USERNAME=username
SMS_PASSWORD=password
SMS_SENDER_ID=sender
SMS_SERVICE=normal