xxc/smsgateway-sender
Composer 安装命令:
composer create-project xxc/smsgateway-sender
包简介
README 文档
README
###Package for the AMDTelecom SMSGateway This package is for standard php project use, but has optimisations for laravel usage.
##Installation composer require xxc/smsgateway-sender
for laravel if you're not using package discovery add
xXc\SmsGatewaySender\SmsGatewaySenderServiceProvider::class
to config/app.php
##Usage
Desired usage
try { $smsGatewaySender = new \xXc\SmsGatewaySender(); $response = $smsGatewaySender ->from('') ->to('') ->message('') ->send(); if ($response->isSent()) { //do whatever } else { //log errors $response->errors //return error message } } catch (\Exception $exception) { //log data //return error based on the exception message?! }
overriding with custom validators can be done via the constructor or via the setters All the custom validator must extend the Validator interface
$smsGatewaySender = new \xXc\SmsGatewaySender($customPhoneValidator, $customMessageValidator); \\or $smsGatewaySender = new \xXc\SmsGatewaySender(); $smsGatewaySender->setPhoneValidator($customPhoneValidator); $smsGatewaySender->setMessageValidator($customMessageValidator);
to publish the config
php artisan vendor:publish
then choose the xXc\SmsServiceProvider tag
Contributing: You can create custom validators for phone numbers or text messages (if needed) and create pull requests
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-04