PHP code example of guilhermedev98 / larasms

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

    

guilhermedev98 / larasms example snippets


App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Yugo\SMSGateway\Providers\SmsServiceProvider::class,

use Facades\Yugo\SMSGateway\Interfaces\SMS;

SMS::send(['62891111111'], 'Hello, how are you?');

// get registered device information
SMS::device(?int $id); // $id is nullable

// get detailed information from message
SMS::info(int $id);

// cancel queued message
SMS::cancel(array $id);

SMS::setDevice(12345) // make sure it's integer value
  ->setToken('secret-token')
  ->send(['08111111111'], 'Message with custom device and token.');

// get credit balance
SMS::credit();

SMS::setUser('you')
  ->setPassword('secret')
  ->send(['08111111111'], 'Message with custom user and password.');

php artisan vendor:publish
config/app.php

php artisan vendor:publish --provider="Yugo\SMSGateway\Providers\SmsServiceProvider"