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"
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(...);
Please see CHANGELOG for more information on what has changed recently.