guilhermedev98/larasms
Composer 安装命令:
composer require guilhermedev98/larasms
包简介
SMS gateway for Laravel using various vendors (SMSGateway.me, Zenziva, etc)
关键字:
README 文档
README
Laravel SMS is a package that has abilities to send and receive SMS via SMS gateway from various vendors such as SMSgateway.me, Zenziva.id, etc.
Table of Contents
Requirements
- PHP 7.0 or above.
- cURL extension for PHP.
- Laravel version 5.4 or above.
Available Vendors
- SMSGateway.me (
smsgatewayme) - Zenziva.id (
zenziva)
Installation Instructions
Install package via Composer by running the command:
composer require yugo/smsgateway -vvv
Publish package assets using the command below:
php artisan vendor:publish
Select package from yugo/smsgateway to automatically copy a config file to your config application directory.
Note: If you are using Laravel version 5.4, you must setup provider manually by adding Yugo\SMSGateway\Providers\SmsServiceProvider::class to your config/app.php file.
App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, Yugo\SMSGateway\Providers\SmsServiceProvider::class,
Then, publish package vendor using command below.
php artisan vendor:publish --provider="Yugo\SMSGateway\Providers\SmsServiceProvider"
SMSGateway.me
To enable and using SMSgateway.me vendor, you must set new configurations based on SMSgateway.me setting. Add two config values like as below.
SMS_VENDOR="smsgatewayme"
SMSGATEWAYME_DEVICE=
SMSGATEWAYME_TOKEN=
Zenziva.id
Login to your Zenziva.id dashboard account to get userkey and passkey value. Add userkey and passkey to .env file using these configurations.
SMS_VENDOR="zenziva"
ZENZIVA_USERKEY=userkey
ZENZIVA_PASSKEY=passkey
Usage
Sending a new message using Laravel SMS is easy. You just import real-time facade from the package and call the available methods inside it.
use Facades\Yugo\SMSGateway\Interfaces\SMS;
Now, you can use class SMS inside your PHP file. Every vendor has send(array $destinations, string $message) method.
Quick example:
SMS::send(['62891111111'], 'Hello, how are you?');
Additional Methods
Some vendors have additional methods. For example, you can check balance when using Zenziva and check device when using SMSGateway.me.
SMSGateway.me
// get registered device information SMS::device(?int $id); // $id is nullable // get detailed information from message SMS::info(int $id); // cancel queued message SMS::cancel(array $id);
By default, SMSgateway.me package will using API configuration from .env file (such as device and token). But, you can set device ID and token programmatically via application. For example:
SMS::setDevice(12345) // make sure it's integer value ->setToken('secret-token') ->send(['08111111111'], 'Message with custom device and token.');
Zenziva.id
// get credit balance SMS::credit();
If you want to set userkey and/or passkey manually, you can using setUser(string $user) and setPassword(string $password) method. For example:
SMS::setUser('you') ->setPassword('secret') ->send(['08111111111'], 'Message with custom user and password.');
License
MIT.
guilhermedev98/larasms 适用场景与选型建议
guilhermedev98/larasms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 09 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「laravel」 「smsgateway」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 guilhermedev98/larasms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 guilhermedev98/larasms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 guilhermedev98/larasms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This is my take on a sms sender interface, that in time should support a lot of different sms gateways.
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
yii2-sms expand
SMSGateway.Me for Laravel
config your sms gateway provider and start sending sms
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-22