PHP code example of smsfactor / smsfactor-laravel

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

    

smsfactor / smsfactor-laravel example snippets


'providers' => [
    // Other service providers...
    SMSFactor\Laravel\SMSFactorServiceProvider::class,
],

use SMSFactor\Laravel\Facade\Account;
use SMSFactor\Laravel\Facade\Campaign;
use SMSFactor\Laravel\Facade\ContactList;
use SMSFactor\Laravel\Facade\Message;
use SMSFactor\Laravel\Facade\Webhook;
use SMSFactor\Laravel\Facade\Token;

'aliases' => [
    ...
    'SMSFactor' => SMSFactor\Laravel\Facade\Account::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\Campaign::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\ContactList::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\Message::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\Webhook::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\Token::class,
],

$response = Message::send([
	'to' => '33600000000',
	'text' => 'Have you ever danced with the devil in the pale moonlight ?'
]);
print_r($response->getJson()); //In case you don't receive your text, printing the API response might be useful

$account = app('SMSFactor\Message');
$response = $account->send([
	'to' => '33600000000',
	'text' => 'Have you ever danced with the devil in the pale moonlight ?'
]);
print_r($response->getJson());
config/app.php
config/app.php

php artisan vendor:publish
config/smsfactor.php