PHPackages                             zhangxiuyu/laravel-mqtt - 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. zhangxiuyu/laravel-mqtt

Active1

zhangxiuyu/laravel-mqtt
=======================

This is mqtt

v1.0.1(5y ago)151Apache-2.0PHPPHP &gt;= 7.1

Since Jul 28Pushed 5y agoCompare

[ Source](https://github.com/zhangxiuyu/laravel-MQTT)[ Packagist](https://packagist.org/packages/zhangxiuyu/laravel-mqtt)[ RSS](/packages/zhangxiuyu-laravel-mqtt/feed)WikiDiscussions master Synced 1mo ago

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

laravel-MQTT
============

[](#laravel-mqtt)

[![Simps License](https://camo.githubusercontent.com/9bdc875302b5b4347098d717e94ebfce822b57cc7a95d030f54eb316b1580dd8/68747470733a2f2f706f7365722e707567782e6f72672f73696d706c652d73776f6f6c652f73696d70732f6c6963656e7365)](https://camo.githubusercontent.com/9bdc875302b5b4347098d717e94ebfce822b57cc7a95d030f54eb316b1580dd8/68747470733a2f2f706f7365722e707567782e6f72672f73696d706c652d73776f6f6c652f73696d70732f6c6963656e7365)[![PHP Version](https://camo.githubusercontent.com/315f5c30e505b9ccc4178451bbd34c2ba5d281d1fa3267304053ed19ab634125/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e312d627269676874677265656e2e737667)](https://www.php.net/)[![Swoole Version](https://camo.githubusercontent.com/046f897c88711f3a7eee1f3ec540eb9b7bf0eeb755d67e92e6093761f0b2f12a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73776f6f6c652d2533453d342e342e302d627269676874677265656e2e737667)](https://github.com/swoole/swoole-src)

### 使用样例:

[](#使用样例)

```
$config = [
    'ip' => '0.0.0.0',
    'port' => 8080,
    'callbacks' => [
    ],
    'receiveCallbacks' => [
        \Mqtt\server\MQTT::CONNECT => [\Mqtt\MqttServer::class, 'onMqConnect'],
        \Mqtt\server\MQTT::PINGREQ => [\Mqtt\MqttServer::class, 'onMqPingreq'],
        \Mqtt\server\MQTT::DISCONNECT => [\Mqtt\MqttServer::class, 'onMqDisconnect'],
        \Mqtt\server\MQTT::PUBLISH => [\Mqtt\MqttServer::class, 'onMqPublish'],
        \Mqtt\server\MQTT::SUBSCRIBE => [\Mqtt\MqttServer::class, 'onMqSubscribe'],
        \Mqtt\server\MQTT::UNSUBSCRIBE => [\Mqtt\MqttServer::class, 'onMqUnsubscribe'],
    ],
    'settings' => [
        'worker_num' => 1,
        'open_mqtt_protocol' => true,
    ],
];

Mqtt\AppServer::run($config);
```

### 效果:

[](#效果)

```
root@5ef6b759adf0:/var/www/PHP/laravel-MQTT/src/mqtt# php Test.php mqtt:start
                  _   _
                 | | | |
  _ __ ___   __ _| |_| |_
 | '_ ` _ \ / _` | __| __|
 | | | | | | (_| | |_| |_
 |_| |_| |_|\__, |\__|\__|
               | |
               |_|           Version: 1.0.3
[2020-07-24 17:20:40] [INFO] Swoole MQTT Server running：mqtt://0.0.0.0:8080
```

### 安装

[](#安装)

可以通过 composer 进行安装。

```
$ composer require zhangxiuyu/laravel-mqtt
```

demo在 项目 server/Test.php 文件中 可以根据文件配置 对象

最后执行你的文件即可， 建议放在项目的bin 目录中 命令： php bin/xxx.php mqtt:start

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

2115d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e0ac83be07a2f1fe646da3df33e4eedf4bf7160b79cb917fb32f140ce97f419?d=identicon)[秀才](/maintainers/%E7%A7%80%E6%89%8D)

---

Top Contributors

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

---

Tags

phpswoole

### Embed Badge

![Health badge](/badges/zhangxiuyu-laravel-mqtt/health.svg)

```
[![Health](https://phpackages.com/badges/zhangxiuyu-laravel-mqtt/health.svg)](https://phpackages.com/packages/zhangxiuyu-laravel-mqtt)
```

###  Alternatives

[simple-swoole/db

A db component for Simps.

216.3k3](/packages/simple-swoole-db)

PHPackages © 2026

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