mlk9/ippanel-laravel
最新稳定版本:v2.0.1
Composer 安装命令:
composer require mlk9/ippanel-laravel
包简介
Send SMS notification based on channel Laravel (Ippanel SMS service)
README 文档
README
پکیج لاراولی ارسال اس ام اس سازگار با نوتیفیکیشن برای آپی پنل
نیازمندی ها
- لاراول 6+
- PHP 7.4+
ویژگی ها
- سریع و ساده
- اتصال امن
- سازگار با نوتیفیکیشن
نصب
نصب پکیج به وسیله کامپوزر:
composer require mlk9/ippanel-laravel
عمومی کردن تنظیمات
php artisan vendor:publish --tag=ippanel-laravel
جزئیات دقیق کانفیگ
// config/services.php 'ippanel' => [ 'server' => 'https://ippanel.com/services.jspd', 'username' => 'YOUR_IPPANEL_USERNAME', 'password' => 'YOUR_IPPANEL_PASSWORD', 'originator' => 'YOUR_IPPANEL_ORIGINATOR', ],
استفاده
با استفاده از فساد
<?php
use Mlk9\Sms\Facades\Sms;
//get credit
Sms::getCredit(); // res : 933222.33
//send message
Sms::sendMessage(string $text,array|string $recipients); // bool
//send pattern message
Sms::sendPatternMessage(string $code_pattern,string $recipient,array $entries = []);// bool
با استفاده از نوتیفیکیشن لاراول
افزودن 'sms' به نوتیفیکیشن مد نظر
و ایجاد فانکشن toSms به این شکل :
class ExampleNotification extends Notification
{
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['sms'];
}
//for pattern sms
public function toSms($notifiable)
{
return [
'type' => 'patternMessage',
'code' => 'YOUR CODE PATTERN',//string
'values' => ['name'=>$notifiable->name],//array
'recipient'=> $notifiable->phone,//string
];
}
//for simple sms
// public function toSms($notifiable)
// {
// return [
// 'type' => 'message',
// 'message' => 'YOUR MESSAGE',
// 'recipient'=> [$notifiable->phone], // shoud be arrray
// ];
// }
统计信息
- 总下载量: 169
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-09