PHP code example of tartan / laravel-iranian-sms

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

    

tartan / laravel-iranian-sms example snippets


    Tartan\IranianSms\SmsServiceProvider::class,

    'IranianSms' => Tartan\IranianSms\Facades\IranianSms::class

    //using the default adapter
    resolve('iraniansms')->make()->send('0912xxxxxxx','this is test message');

    //using kavenegar adapter with default config
    resolve('iraniansms')->make('kavenegar')->send('0912xxxxxxx','this is test message');

    //using kavenegar adapter with sender2 config
    resolve('iraniansms')->make('kavenegar', 'sender2')->send('0912xxxxxxx','this is test message');

    //using Facede
    use Iraniansms;
    Iraniansms::make()->send('0912xxxxxxx','this is test message');



return [
	//Default SMS gateway
	'default' => env('IRANIANSMS_DEFAULT','log'),
	'mehrafraz' => [
		'gateway' => env('IRANIANSMS_MEHRAFRAZ_GATEWAY','http://mehrafraz.com/webservice/Service.asmx?WSDL'),
		'username' => env('IRANIANSMS_MEHRAFRAZ_USERNAME'),
		'password' => env('IRANIANSMS_MEHRAFRAZ_PASSWORD'),
	],
	'kavenegar' => [
		'gateway' => env('IRANIANSMS_KAVENEGAR_GATEWAY','http://api.kavenegar.com/v1/%s/%s/%s.json/'),
		'api_key' => env('IRANIANSMS_KAVENEGAR_APIKEY'),
		'sender' => env('IRANIANSMS_KAVENEGAR_SENDER'),
        'sender2' => [
            'gateway' => env('IRANIANSMS_KAVENEGAR_SENDER2_GATEWAY','http://api.kavenegar.com/v1/%s/%s/%s.json/'),
		    'api_key' => env('IRANIANSMS_KAVENEGAR_SENDER2_APIKEY'),
		    'sender' => env('IRANIANSMS_KAVENEGAR_SENDER2_SENDER'),
        ],       
	],
	'smsir' => [
		'gateway' => env('IRANIANSMS_SMSIR_GATEWAY', 'http://ip.sms.ir/SendMessage.ashx'),
		'user' => env('IRANIANSMS_SMSIR_USER'),
		'pass'  => env('IRANIANSMS_SMSIR_PASS'),
		'line_no'  => env('IRANIANSMS_SMSIR_LINENO'),
	],
	'ghasedak'=> [
		'api_key' => env('IRANIANSMS_GHASEDAK_APIKEY'),
		'sender'  => env('IRANIANSMS_GHASEDAK_SENDER'),
	],

    'parsasms' => [
        'gateway' => env('IRANIANSMS_PARSASMS_GATEWAY','http://api.parsasms.com/v2/sms/send/simple'),
        'api_key' => env('IRANIANSMS_PARSASMS_APIKEY'),
        'sender' => env('IRANIANSMS_PARSASMS_SENDER')
    ],

    'slack' => [
        'url' => env('IRANIANSMS_SLACK_URL')
    ],

    'discord' => [
        'url' => env('IRANIANSMS_DISCORD_URL')
    ],
];
bash
php artisan vendor:publish --provider="Tartan\IranianSms\SmsServiceProvider" --tag=config