frolax/ultimate-sms-notification-channel
最新稳定版本:v1.0.0
Composer 安装命令:
composer require frolax/ultimate-sms-notification-channel
包简介
Laravel notification channel for Ultimate SMS
README 文档
README
This package provides a Laravel notification channel for sending SMS via the Ultimate SMS HTTP API.
Installation
composer require frolax/ultimate-sms-notification-channel
Publish the config file:
php artisan vendor:publish --provider="UltimateSmsNotificationChannel\\UltimateSmsServiceProvider" --tag=config
Configuration
Add the following to your .env:
ULTIMATE_SMS_BASE_URL=https://sms.frolax.net
ULTIMATE_SMS_API_KEY=your_api_key
ULTIMATE_SMS_SENDER_ID=YourName
ULTIMATE_SMS_DLT_TEMPLATE_ID=optional
ULTIMATE_SMS_BASE_URLshould be the website base URL only (e.g.,https://sms.frolax.net).- The package will automatically use the correct API endpoint for sending SMS.
Usage
In your notification:
use UltimateSmsNotificationChannel\UltimateSmsMessage; public function via($notifiable) { return ['ultimate_sms']; } public function toUltimateSms($notifiable) { return (new UltimateSmsMessage()) ->content('This is a test message'); }
Or route notification:
use Illuminate\Support\Facades\Notification; use App\Notifications\YourNotification; Notification::route('ultimate_sms', '31612345678')->notify(new YourNotification());
Sending to Multiple Recipients
You can send to multiple numbers by passing a comma-separated string:
UltimateSmsMessage::create('This is a test message') ->to('31612345678,880172145789');
Using the Facade Directly
You can send an SMS directly using the facade if you want to bypass Laravel's notification system:
use UltimateSmsNotificationChannel\Facades\UltimateSms; UltimateSms::send([ 'recipient' => '+8801322635808', 'message' => 'Hello', 'sender_id' => 'HaQuick', 'type' => 'plain', ]);
Optional Parameters
sender_id: Override the default sender ID.type: Set the message type (default:plain).schedule_time: Schedule the SMS (format:YYYY-MM-DD HH:MM).dlt_template_id: Set a DLT template ID (optional).
Testing
vendor/bin/pest
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-03