1.Installing Via composer
composer require iamtartan/laravel-iranian-sms
2.Add this to your app service providers :
Tartan\IranianSms\SmsServiceProvider::class,
3.Add this to your aliases :
'IranianSms' => Tartan\IranianSms\Facades\IranianSms::class
4.Publish the config file
php artisan vendor:publish --tag=config
//using the default adapter
resolve('iranian_sms')->make()->send('0912xxxxxxx','test2x');
//using kavenegar adapter
resolve('iranian_sms')->make('kavenegar')->send('0912xxxxxxx','test2x');
//using Facede
use IranianSms;
IranianSms::make()->send('0912xxxxxxx','test2x');
* mehrafzar
* kavenegar
<?php
return [
//Default SMS gateway
'default' => env('IRANIANSMS_DEFAULT','mehrafzar'),
'mehrafzar' => [
'gateway' => env('IRANIANSMS_MEHRAFZAR_GATEWAY','http://mehrafraz.com/webservice/Service.asmx?WSDL'),
'username' => env('IRANIANSMS_MEHRAFZAR_USERNAME','test'),
'password' => env('IRANIANSMS_MEHRAFZAR_PASSWORD','test'),
],
'kavenegar' => [
'gateway' => env('IRANIANSMS_KAVENEGAR_GATEWAY','http://api.kavenegar.com/v1/%s/%s/%s.json/'),
'api_key' => env('IRANIANSMS_KAVENEGAR_APIKEY','test'),
'sender' => env('IRANIANSMS_KAVENEGAR_SENDER','test'),
]
];