PHPackages                             niceyo/xhy-sms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. niceyo/xhy-sms

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

niceyo/xhy-sms
==============

sms SDK.

1.0.0(6y ago)629MITPHP

Since Aug 3Pushed 6y ago2 watchersCompare

[ Source](https://github.com/naisimemeda/XhySms)[ Packagist](https://packagist.org/packages/niceyo/xhy-sms)[ RSS](/packages/niceyo-xhy-sms/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

 xhy-sms
=========

[](#-xhy-sms-)

 基于 Aliyun or Qcloud 的 PHP 短信发送扩展。

[![Build Status](https://camo.githubusercontent.com/1fc2c2d5c56ca216af614671d633c8937eb5ecbd3221bd3badacfc5dbb2c63ff/68747470733a2f2f7472617669732d63692e6f72672f6e616973696d656d6564612f586879536d732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/naisimemeda/XhySms)[![StyleCI build status](https://camo.githubusercontent.com/730a8bce989c4cad07b34c1d0cefbdf797afeed238e1e561fc16c95cad3aa6f5/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3230303339313635372f736869656c64)](https://camo.githubusercontent.com/730a8bce989c4cad07b34c1d0cefbdf797afeed238e1e561fc16c95cad3aa6f5/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3230303339313635372f736869656c64)

Installing
----------

[](#installing)

```
$ composer require niceyo/xhy-sms -vvv
```

Laravel 中使用
-----------

[](#laravel-中使用)

首先在 config 目录中增加 xhysms.php 文件

```
touch config/xhysms.php
```

配置示例
----

[](#配置示例)

```
return [
    'gateways' => [  //需要使用那个配置那个
        'aliyun' => [
            'access_key_id' => env('ALIYUN_API_KEY'),
            'access_key_secret' => env('ALIYUN_API_KEY_SECRET'),
            'sign_name' => env('SIGN_NAME'),
        ],
        'qcloud' => [
            'sdk_app_id' => '', // SDK APP ID
            'app_key' => '', // APP KEY
            'sign_name' => '',
        ],
    ],
];
```

使用
--

[](#使用)

```
    use Nice\XhySms\XhySms;
    /*
        扩展包已经自己绑定一个单例到容器中 所以你也可以这样
        app('XhySms')->send();
    */
    public function show(XhySms $Sms) {  //阿里云
        $Sms->send('185****4076', [
            'template' => 'SMS_******34',
            'data' => [
              'code' => 123456   //变量名
            ]
        ],'aliyun');
    }

    public function show(XhySms $Sms) {  //腾讯云
            $Sms->send('185****4076', [
            'template' => '6***9',
            'data' => [
                123456, 555555
            ]
        ],'qcloud');
    }

```

其他项目中使用
-------

[](#其他项目中使用)

```
    $config =  [
        'gateways' => [
            'aliyun' => [
                'access_key_id' => '',
                'access_key_secret' => '',
                'sign_name' => '',
            ],
            'qcloud' => [
                'sdk_app_id' => '', // SDK APP ID
                'app_key' => '', // APP KEY
                'sign_name' => '',
            ],
        ],
    ];

    $Sms = new XhySms($config);

    $Sms->send('185****4076', [
       'template' => 'SMS_******34',
       'data' => [
          'code' => 123456
       ]
    ],'aliyun');

```

文档参考
----

[](#文档参考)

- [阿里云](https://help.aliyun.com/document_detail/101414.html?spm=a2c4g.11174283.6.616.8a632c42uq6xsD)
- [腾讯云 SMS](https://cloud.tencent.com/document/product/382/5976)

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2522d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30319290?v=4)[夏海洋](/maintainers/naisimemeda)[@naisimemeda](https://github.com/naisimemeda)

---

Top Contributors

[![naisimemeda](https://avatars.githubusercontent.com/u/30319290?v=4)](https://github.com/naisimemeda "naisimemeda (11 commits)")

### Embed Badge

![Health badge](/badges/niceyo-xhy-sms/health.svg)

```
[![Health](https://phpackages.com/badges/niceyo-xhy-sms/health.svg)](https://phpackages.com/packages/niceyo-xhy-sms)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751284.3k37](/packages/civicrm-civicrm-core)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[nfse-nacional/nfse-php

This is my package nfse

1523.1k](/packages/nfse-nacional-nfse-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
