mobily短信 / Phpanonymous
由 PhpAnonymous 创建的 SMS 包
dev-master
2016-10-01 10:56 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-08-29 03:36:25 UTC
README
步骤简单。
1 - 使用 composer 安装
composer require mobilysms/phpanonymous:dev-master
2 - 在配置文件夹的 app.php 中添加提供者类。
Mobilysms\Phpanonymous\MobilySmsPhpAnonymous::class,
3 - 添加别名类
'Mobily' => Mobilysms\Phpanonymous\Mobily::class,
4 - 然后,从 composer 调用此命令。
php artisan vendor:publish
5 - 仅调用方法
Mobily::send(20123456789,'Your Message Here ');
您可以从项目中的此路径获取此文件 config/mobilysms.php
您还可以编辑账户信息,例如使用 mobily.ws 发送者名称和手机号或用户账户和密码。如果您想编辑更多信息,例如 timesend 或 datasend 等,都很简单 :)!
return [ 'sender' =>'Anonymous', // Sender Name With Mobily.ws 'mobile' =>'123456789', // Mobile User Account With Mobily.ws 'password'=>'password here', // Password Account With Mobile.ws 'timeSend'=>0, // If You Don't know what this please don't change anything 'dateSend'=>0, // If You Don't know what this please don't change anything 'deleteKey'=>152485, // If You Don't know what this please don't change anything 'resultType'=>1, // If You Don't know what this please don't change anything 'viewResult'=>1, // If You Don't know what this please don't change anything 'MsgID'=>rand(0000,9999), // If You Don't know what this please don't change anything ];
您还可以在控制器中使用 Mobily 类,非常简单。
## 配置
您可以通过默认区域文件夹编辑语言文件,并将您的信息放入配置文件夹中的 mobilysms.php 文件。
如果遇到问题,您将知道如何解决它。
此包由 phpanonymous 拥有者团队 php anonymoues 开发者创建,在 Facebook 上,您可以加入我们 https://#/groups/anonymouses.developers
如果您想检查发送的消息,很简单,此包返回的结果是 true 而不是字符串。
$send = Mobily::send(123456789,'message'); if($send == true) { echo 'message sent'; }else{ echo $send; }