Giter Site home page Giter Site logo

laravel-iranian-sms's Introduction

Laravel SMS Component

Laravel Package for dealing with Iranian SMS prodivers working with Laravel 5 & 6

Installation

1.Installing Via composer

composer require tartan/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 --provider="Tartan\IranianSms\SmsServiceProvider" --tag=config

Usage Example :

    //using the default adapter
    resolve('iraniansms')->make()->send('0912xxxxxxx','test2x');

    //using kavenegar adapter
    resolve('iraniansms')->make('kavenegar')->send('0912xxxxxxx','test2x');


    //using Facede
    use Iraniansms;
    Iraniansms::make()->send('0912xxxxxxx','test2x');

available adapters

  • log (no charge adapter for development purposes)
  • slack (no charge adapter for development and staging environment)
  • mehrafraz مهر افراز
  • kavenegar کاوه نگار
  • smsir اسمس آی آر
  • ghasedak قاصدک

Example config:

<?php

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','test'),
		'password' => env('IRANIANSMS_MEHRAFRAZ_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'),
	],
	'smsir' => [
		'gateway' => env('IRANIANSMS_SMSIR_GATEWAY', 'http://ip.sms.ir/SendMessage.ashx'),
		'user' => env('IRANIANSMS_SMSIR_USER', 'test'),
		'pass'  => env('IRANIANSMS_SMSIR_PASS', 'test'),
		'line_no'  => env('IRANIANSMS_SMSIR_LINENO', 'test'),
	],
	'ghasedak'=> [
		'api_key' => env('IRANIANSMS_GHASEDAK_APIKEY', 'test'),
		'sender'  => env('IRANIANSMS_GHASEDAK_SENDER', 'test'),
	],
];

laravel-iranian-sms's People

Contributors

sinamiandashti avatar samuraee avatar pyramid-head avatar kamyarmeshkabadi avatar khalilst avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.