syndrom7/ooredoo-sms
Composer 安装命令:
composer require syndrom7/ooredoo-sms
包简介
Laravel package for Ooredoo SMS Caster API integration
README 文档
README
A Laravel package for integrating with the Ooredoo SMS Caster API (Maldives).
Requirements
- PHP 8.1 or higher
- Laravel 10.x or 11.x
Installation
Install via Composer:
composer require syndrom7/ooredoo-sms
Publish the configuration file:
php artisan vendor:publish --tag=ooredoo-sms-config
Configuration
Add the following to your .env file:
OOREDOO_SMS_BEARER_TOKEN=your-bearer-token OOREDOO_SMS_USERNAME=your-username OOREDOO_SMS_ACCESS_KEY=your-access-key
The default endpoint is https://o-papi1-lb01.ooredoo.mv/bulk_sms/v2. You can override this in the published config file or via the OOREDOO_SMS_ENDPOINT environment variable.
Usage
Basic Usage
use Syndrom\OoredooSms\Facades\OoredooSms; // Send to single recipient OoredooSms::send('9609166818', 'Your message here'); // Send to multiple recipients OoredooSms::send(['9609166818', '9609166819'], 'Bulk message');
Fluent API
OoredooSms::to('9609166818') ->message('Your message here') ->send(); // Multiple recipients OoredooSms::to(['9609166818', '9609166819']) ->message('Bulk message') ->send();
Response Handling
The send() method returns the API response as an array:
$response = OoredooSms::send('9609166818', 'Test message');
Successful Response:
[
'response_code' => 0,
'response_message' => 'Message sent successfully',
'delivery_numbers' => '9609166818'
]
Response Fields:
response_code: Status code (0 = success)response_message: Human-readable status messagedelivery_numbers: Comma-separated list of recipient numbers
Usage Example:
$response = OoredooSms::send('9609166818', 'Your message'); if ($response['response_code'] === 0) { // SMS sent successfully $delivered = $response['delivery_numbers']; } else { // Handle error $error = $response['response_message']; }
Error Handling
The package throws OoredooSmsException for validation errors and API failures:
use Syndrom\OoredooSms\Exceptions\OoredooSmsException; try { OoredooSms::send('9609166818', 'Your message'); } catch (OoredooSmsException $e) { // Handle error Log::error('SMS failed: ' . $e->getMessage()); }
Testing
composer test
Configuration Options
The following options are available in config/ooredoo-sms.php:
| Option | Description | Default |
|---|---|---|
endpoint |
API endpoint URL | https://o-papi1-lb01.ooredoo.mv/bulk_sms/v2 |
bearer_token |
Bearer token for authentication | From .env |
username |
Ooredoo account username | From .env |
access_key |
API access key | From .env |
timeout |
HTTP request timeout (seconds) | 30 |
License
MIT License. See LICENSE for details.
syndrom7/ooredoo-sms 适用场景与选型建议
syndrom7/ooredoo-sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「laravel」 「maldives」 「Ooredoo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 syndrom7/ooredoo-sms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 syndrom7/ooredoo-sms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 syndrom7/ooredoo-sms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Bindings for the BML Connect API
PHP SDK for Dhiraagu Bulk SMS Gateway
Laravel wrapper for BML Connect PHP SDK
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Laravel notification channel for Dhiraagu Bulk SMS Gateway
Payment processing with Bank of Maldives/Maldives Payment Gateway (MPG), Maldives Islamic Bank (MIB) & MFaisaa by Oooredoo Maldives.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-14