Download the PHP package hahadu/laravel-notfication-sms without Composer
On this page you can find all versions of the php package hahadu/laravel-notfication-sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-notfication-sms
Laravel SMS Notification 使用指南
这个包提供了一个简单的方式在 Laravel 应用中发送短信通知。
快速开始
1. 配置短信服务
在 config/sms.php 中配置您的短信服务参数,或在 .env 文件中设置:
2. 创建通知类
3. 配置模型
在需要接收短信通知的模型中(如 User 模型):
4. 发送通知
高级用法
自定义短信内容和回调
批量发送
自定义短信客户端
如果需要在运行时修改短信配置:
常见问题
-
模板参数格式
- 参数必须是数组形式
- 键名必须与短信模板中的变量名一致
-
错误处理
- 所有的发送错误都会抛出异常
- 建议使用 try-catch 捕获并处理异常
- 队列配置
- 通知默认使用队列发送
- 确保已配置队列驱动
- 可以通过
php artisan queue:work处理队列
调试建议
-
开发环境中查看日志:
- 测试短信发送:
注意事项
- 确保配置了正确的短信服务凭证
- 注意短信模板的参数匹配
- 建议使用队列发送短信
- 注意处理发送失败的情况
- 在生产环境中妥善保护短信配置信息
All versions of laravel-notfication-sms with dependencies
PHP Build Version
Package Version
The package hahadu/laravel-notfication-sms contains the following files
Loading the files please wait ...