fahad-larasoft / tallbob
通过简单的外观处理Tall Bob SMS API
dev-master
2023-08-24 14:19 UTC
Requires
- php: ~7.0|^8.0
- guzzlehttp/guzzle: ^7.0.1
- illuminate/support: ^8.0|^9.0|^10.0
Requires (Dev)
- orchestra/testbench: ~3.7.0
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-09-24 16:36:45 UTC
README
使用Tall Bob API发送SMS/MMS的Laravel包
安装
通过composer安装
composer require fahad-larasoft/tallbob
注册服务提供者
注意!如果你使用laravel≥5.5并且启用了包自动发现功能,以下步骤是可选的。
将服务提供者添加到config/app.php
中的providers
部分
Larasoft\TallBobSms\ServiceProvider::class,
注册外观
在config/app.php
中的aliases
部分注册包外观
Larasoft\TallBobSms\Facades\TallBobSms::class,
发布配置文件
php artisan vendor:publish --provider="Larasoft\TallBobSms\ServiceProvider" --tag="config"
发布后,config/tallbobsms.php
配置文件包含
return [ /** * Sender Id to be sent with request */ 'sender_id' => env('TALLBOB_SENDER_ID', env('APP_NAME')), /** * API Username provided by Tall Bob for API */ 'api_username' => env('TALLBOB_API_USERNAME', ''), /** * API Key provided by Tall Bob for API */ 'api_key' => env('TALLBOB_API_KEY', ''), /** * To check if API is in test mode */ 'test_mode' => env('TALLBOB_TEST_MODE', false), ];
你可以根据自己的需要修改它。
用法
- 发送MMS
TallBobSms::message($message) ->senderId($sender_id) ->number($mobile_number) // with country code ->subject($subject) ->fileUrl($file_url) // URL of file src ->sendMMS();
- 发送SMS
TallBobSms::message($message) ->senderId($sender_id) ->number($mobile_number) // with country code ->send();
安全性
如果你发现任何安全问题,请通过电子邮件而不是问题跟踪器来报告。