Skip to content

Laravel component for working with Iranian SMS Providers. Any contribution will be appreciated.

License

Notifications You must be signed in to change notification settings

sinamiandashti/laravel-iranian-sms

Repository files navigation

Laravel SMS Component

Installation

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

Usage Example :

    //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');

available adapters

* mehrafzar
* kavenegar

Example config:

<?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'),
	]
];

About

Laravel component for working with Iranian SMS Providers. Any contribution will be appreciated.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages