ahmed-aliraqi / mobilysms
mobilysms 的短信包
1.0.1
2017-05-09 09:41 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-08-29 04:40:38 UTC
README
它非常简单。
1 - 使用 composer 安装
composer require ahmed-aliraqi/mobilysms
2 - 在配置文件夹的 app.php 中添加提供者类。
Mobilysms\MobilySmsProvider::class,
3 - 添加别名类
'Mobily' => Mobilysms\Mobily::class,
4 - 然后从 composer 调用此命令。
php artisan vendor:publish
5 - 仅调用方法
Mobily::send(20123456789,'Your Message Here ');
您可以从项目中的此路径获取此文件 config/mobilysms.php
并且您可以编辑账户信息,如 mobily.ws 发送者名称和手机或用户账户和密码。如果您想,还可以编辑更多信息,例如 timesend 或 datasend 等。很简单 :)
return [ 'sender' =>'Ahmed', // 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 文件。
如果遇到问题,您将知道如何解决。
如果您想检查发送的消息,很简单,该包返回的结果是 true,而不是字符串。
$send = Mobily::send(123456789,'message'); if($send == true) { echo 'message sent'; }else{ echo $send; }