Easily send sms in laravel with any sms service provider.
Provider |
---|
Kavenegar |
SMS.IR |
- install the package via composer:
composer require parhaaam/sendsms
- publish the config file with:
php artisan vendor:publish --tag="sendsms-config"
This is the contents of the published config file:
return [
'default' => 'kavenegar',
'drivers' => [
'kavenegar' => [
'key' => env('kavenegar_key', ''),
],
'smsir' => [
'key' => env('smsir_key', ''),
'secret' => env('smsir_key', ''),
]
]
];
// Send Lookup sms
$sendSms = new Parhaaam\SendSms();
$sendSms->sendLookup($receptor = "__phone_number__", $template = "loginVerify", $tokens = ["Test"]);
// will send sms using default sms provider which has been set in config/sendsms.php
// Send Lookup sms with sms.ir
$sendSms = new SendSms();
$sendSms
->via('smsir')
->sendLookup($receptor = "__phone_number__", $template = "19737", ["token_one_name" => "token_value", "token_two_name" => "token_two_value"]);
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.