rupeshdahal/nepal-mobile-operators
Composer 安装命令:
composer require rupeshdahal/nepal-mobile-operators
包简介
A Laravel package to identify mobile operators in Nepal based on number prefixes
README 文档
README
A Laravel package to identify mobile operators in Nepal based on number prefixes.
Installation
You can install the package via composer:
composer require rupeshdahal/nepal-mobile-operators
The package will automatically register its service provider.
You can publish the configuration file with:
php artisan vendor:publish --provider="RupeshDai\NepalMobileOperators\NepalMobileOperatorsServiceProvider" --tag="config"
Usage
Basic Usage
use RupeshDai\nepalimobileoperator\src\Facades\NepalMobileOperators; // Get the operator name $operator = NepalMobileOperators::getOperator('9841234567'); // Returns: "Ntc (Namaste SIM)" // Check if a number is valid $isValid = NepalMobileOperators::isValid('9841234567'); // Returns: true // Get detailed information $details = NepalMobileOperators::getOperatorDetails('9841234567'); // Returns: [ // 'operator' => 'Ntc (Namaste SIM)', // 'prefixes' => ['984', '985', '986', '976'], // 'technology' => 'GSM' // ]
Direct Class Usage
If you prefer not to use the facade, you can also use the class directly:
use Neputer\NepalOperatorIdentifier\NepalMobileOperators; $detector = new NepalMobileOperators(); $operator = $detector->getOperator('9841234567');
Available Operators
The package currently supports the following operators:
| Operator | Prefixes | Technology |
|---|---|---|
| Ntc (Namaste SIM) | 984, 985, 986, 976 | GSM |
| Ntc (Earlier CDMA, now with GSM) | 974, 975 | CDMA/GSM |
| Ncell | 980, 981, 982, 970 | GSM |
| Smart Cell | 961, 962, 988 | GSM |
| UTL | 972 | CDMA |
| Hello Mobile | 963 | GSM |
Number Format Handling
The package handles various phone number formats:
- Standard 10-digit numbers:
9841234567 - Numbers with country code:
+9779841234567or9779841234567 - Numbers with leading zero:
09841234567 - Formatted numbers:
984-123-4567or984 123 4567
Custom Configuration
After publishing the config file, you can add custom operators or modify validation settings:
// config/nepalmobileoperators.php return [ 'custom_operators' => [ 'New Operator' => [ 'prefixes' => ['990'], 'technology' => 'GSM' ], ], 'validation' => [ 'strict_length' => true, ], ];
Testing
composer test
Contributing
Please see CONTRIBUTING.md for details.
License
The MIT License (MIT). Please see License File for more information.
rupeshdahal/nepal-mobile-operators 适用场景与选型建议
rupeshdahal/nepal-mobile-operators 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 5, 最近一次更新时间为 2025 年 05 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 rupeshdahal/nepal-mobile-operators 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rupeshdahal/nepal-mobile-operators 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-15