Giter Club home page Giter Club logo

sms's Introduction

enter image description here

Iranian SMS

Easily use Iranian SMS services :)

Installation:

composer require alighale/sms

You must add the service provider to config/app.php

'providers' => [
	 // for laravel 5.8 and below
	 \Serjik\Sms\SmsServiceProvider::class,
];

Publish your config file

php artisan vendor:publish

Configuration:

.env

SMS_DRIVER=kavenegar // or another services

config/sms.php

    /**  
     * sms driver 
     * [ 'kavenegar', 'ghasedak', ... ] 
     */  
    'driver' => env('SMS_DRIVER'),  
  
  
    /**  
     * drivers config 
     */  
    'drivers' => [
      
     /**  
      * for install this service on your app run this: 
      *                      composer require kavenegar/php:1.2 
      */  
     'kavenegar' => [  
         'api_key' => "kavenegar api key",  
         'line_number' => "10004346",  
     ],
       
     /**  
      * for install this service on your app run this: 
      *                      composer require ghasedak/php:"dev-master" 
      */  
     'ghasedak' => [  
         'api_key' => "ghasedak api key",  
         'line_number' => "10008566",  
//            'any_parameter' => 'any value',  
     ],  
  
//        EXAMPLE  
//        'your_driver' => [  
//            'parameters' => '',  
//            'provider' => \App\Sms\YourServiceName::class,  
//        ],  
  
  ],

Support of Iranian Sms services:

Title Url installer
kavenegar https://kavenegar.com/ composer require kavenegar/php:1.2
ghasedak https://ghasedak.io/ composer require ghasedak/php:"dev-master"

We will add more services in the future. For use of services first install this package :)

Lets start to use:

Single mode:

//	\Serjik\Sms\Facades\Sms

/** @var BaseSmsDriver $result */
$result = Sms::to('09210125463')->send('test package');

Group mode:

You can use the group service in two ways

Note: in all send methods the result is service result or array of that.

The first method:

Send a fixed message to the numbers

/** @var BaseSmsDriver $result */
$result = Sms::to(['09210484017', ...])->send('test package');

The second method:

Send number specific message. Send message[0] => number[0], .... and so on

/** @var BaseSmsDriver $result */
$result = Sms::to(['09210484017', ...])
	->send(['test package', ....]);

Driver replacement at the moment:

$result = Sms::driver('driver_name')
	->to('number or array of numbers')
	->send('message or array of messages');

sms's People

Contributors

alighaleyan avatar

Watchers

 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.