moeen-basra/send-pk
最新稳定版本:v1.1.0
Composer 安装命令:
composer require moeen-basra/send-pk
包简介
Send SMS via SendPk
README 文档
README
The package for laravel to send sms messages using the send pk
Prerequisites
- php >= 8.1
- guzzlehttp/guzzle >= 7
Installation
composer require moeen-basra/send-pk
Publish config
php artisan vendor:publish --tag send-pk-config
Publish lang if you want localization
php artisan vendor:publish --tag send-pk-lang
How to use
Before moving forward make sure you update the config/send-pk.php file.
Using the SmsMessage
<?php use MoeenBasra\SendPk\SmsMessage class MyClass { public function sendMessage(): void { $response = (new SmsMessage()) ->fields('template_id', confg('send-pk.templates.{my_template_id}')) ->fields('message', [ // template parameters ]); if ($response->code === 200) { // handle success } else { // handle failed } } }
Using the container
<?php class MyClass { public function sendMessage(): void { $response = app('send-pk') ->send($phone_number, [ 'template_id' => confg('send-pk.templates.{my_template_id}'), 'message' => [ // template parameters ] ]); if ($response->code === 200) { // handle success } else { // handle failed } } }
Contact
Reach me at email here
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-28