ringlesoft/jasmin-client
Composer 安装命令:
composer require ringlesoft/jasmin-client
包简介
A laravel package for interacting with Jasmin SMS Gateway
README 文档
README
A Laravel package for seamless integration with Jasmin SMS Gateway, supporting HTTP, REST API, and SMPP connections.
Features
- Easy-to-use interface for sending and receiving SMS
- Support for HTTP and REST API jasmin options
- SMPP support is coming soon
- Delivery report handling
Installation
You can install the package via composer:
composer require ringlesoft/jasmin-client
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="RingleSoft\JasminClient\JasminClientServiceProvider"
Then, edit the config/jasmin_client.php file with your Jasmin SMS Gateway credentials and preferred settings.
Available configurations
The following are available configurations. Most of these are just defaults and can be overridden in your code
url: The base url of the jasmin server (include the port if different from80or443/446)username: The username for your jasmin accountpassword: The password for your jasmin accountdlr_callback_url: The default sms delivery callback urlbatch_callback_url: the default batch callback urlbatch_errback_url: the default batch errback urldefault_dlr_method: the default dlr method (GET/POST)default_dlr_level: The default DLR level (1, 2, or 3)batch_chunk_size: The default Chunk size for batches
Usage
Sending an SMS
Sending a single message (Http & Rest)
$sms = JasminClient::message() ->content('Hello there! Have a nice day') ->to("255711000000") ->from('INFO') ->via('rest') // 'rest' or 'http' ->send();
- Returns
RingleSoft\JasminClient\Models\Jasmin\SentMessage
Sending multiple messages as a batch (Rest only)
$message = JasminClient::message(to: "255711000000", content: "Hello There. Have a nice day"); $message2 = JasminClient::message(to: "255711000002", content: "Hello There. Have a nice day"); $batch = JasminClient::batch() ->addMessage($message) ->addMessage($message2) ->from("INFO") ->send();
- Returns
RingleSoft\JasminClient\Models\Jasmin\SentBatch
Handling Delivery Statuses
This package provides a streamlined way to handle delivery statuses.
Class DlrController extends Controller { public function handleDlr(Request $request) { return JasminClient::receiveDlrCallback($request, function(DeliveryCallback $dlr) { // do something with the dlr and return true for success or false for failure // For example, you can dispatch a job to process the Delivery Report return true; }); } }
Handling Batch Callback Requests
When messages are sent in a batch, Jasmin responds with the ID of the batch created (batchId) and enqueue the messages.
When each message is sent to SMC, jasmin fires a callback (batch callback) with messageId of each message within the
batch.
To handle batch callbacks, you can use the receiveBatchCallback method.
Class DlrController extends Controller { public function handleDlr(Request $request) { return JasminClient::receiveDlrCallback($request, function(DeliveryCallback $dlr) { // do something with the dlr and return true for success or false for failure // For example, you can dispatch a job to process Batch Callback return true; }); } }
Checking rates (Http & Rest)
$route = JasminClient::rest()->checkRoute("255711000000");
Checking account balance (Http & Rest)
$balance = JasminClient::rest()->checkBalance();
Monitoring Metrics (Http)
$metrics = JasminClient::http()->getMetrics();
Contributing
I'll soon let you know when you can contribute to this project.
License
This package is open-sourced software licensed under the MIT license.
Support
Contacts
Follow me on X: @ringunger
Email me: ringunger@gmail.com
Website: https://ringlesoft.com
Note: This package is still under development. Please report any issues you encounter.
ringlesoft/jasmin-client 适用场景与选型建议
ringlesoft/jasmin-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 62 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 09 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「laravel」 「smpp」 「sms gateway」 「jasmin」 「ringlesoft」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ringlesoft/jasmin-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ringlesoft/jasmin-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ringlesoft/jasmin-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Symfony SMPP Client Bundle
SMS sending via SMPP protocol for Laravel framework.
SMPP Client
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
A Laravel package for sending SMS using the SMPP protocol, built on top of the PHP-SMPP library. This package provides a simple and efficient way to integrate SMS functionality into your Laravel applications.
统计信息
- 总下载量: 62
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-15