Skip to content

MahdiMajidzadeh/laravel-kavenegar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Kavenegar

StyleCI packagist status

Install

Via Composer

$ composer require mahdimajidzadeh/kavenegar

If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:

MahdiMajidzadeh\Kavenegar\KavenegarServiceProvider:class

If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider.

You must publish the configuration to provide an own service provider stub.

$ php artisan vendor:publish --provider="MahdiMajidzadeh\kavenegar\KavenegarServiceProvider"

Usage

See documention for params and others at kavenegar docs

$sms = new KavenegarSMS();
$result = $sms->send($receptor, $message);

$sms->status; // like 200
$sms->message; // like "تایید شد"

All available methods:

$sms = new KavenegarSMS();
$sms->send(...);
$sms->sendArray(...);
$sms->status(...);
$sms->statusLocalMessageid(...);
$sms->select(...);
$sms->selectOutbox(...);
$sms->latestOutbox(...);
$sms->countOutbox(...);
$sms->cancel(...);
$sms->countInbox(...);
$sms->receive(...);
$sms->countPostalcode(...);
$sms->sendByPostalcode(...);

$verify = new KavenegarVerify();
$verify->lookup(...);

Change log

Please see CHANGELOG for more information on what has changed recently.