PHP code example of creatvstudio / itexmo

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

    

creatvstudio / itexmo example snippets


# config/app.php

'providers' => [
    ...

    /*
     * Package Service Providers...
     */

    ...

    CreatvStudio\Itexmo\ItexmoServiceProvider::class,
]

# config/services.php

...

'ses' => [
    'key' => env('AWS_ACCESS_KEY_ID'),
    'secret' => env('AWS_SECRET_ACCESS_KEY'),
    'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],

'itexmo' => [
    'code' => env('ITEXTMO_CODE'),
    'password' => env('ITEXMO_PASSWORD'),
    'sender_id' => env('ITEXMO_SENDER_ID'),
]

# config/app.php

'aliases' => [
    ...

    'Itexmo' => CreatvStudio\Itexmo\Facades\Itexmo::class,

]

Itexmo::to('09171234567')->content('Hello fellow humans!')->send();



namespace App\Http\Controllers;

use Illuminate\Http\Request;
use CreatvStudio\Itexmo\Itexmo;

class SmsController extends Controller
{
    /**
     * Send an sms message
     *
     * @param  Request  $request
     * @param  Itexmo   $itexmo
     * @return Response
     */
    public function store(Request $request, Itexmo $itexmo)
    {
        $itexmo->to($request->to)
            ->content($request->content)
            ->send();

        //
    }
}