PHPackages                             xpx/laravel-micro-service - 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. [Framework](/categories/framework)
4. /
5. xpx/laravel-micro-service

ActiveLibrary[Framework](/categories/framework)

xpx/laravel-micro-service
=========================

The micro service support for laravel

v1.0.2(5y ago)03MITPHPCI failing

Since May 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sea24/xpx-laravel-micro-service)[ Packagist](https://packagist.org/packages/xpx/laravel-micro-service)[ RSS](/packages/xpx-laravel-micro-service/feed)WikiDiscussions master Synced 1mo ago

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

 Laravel 微服务拓展包
================

[](#-laravel-微服务拓展包-)

> 该模块为 Laravel 提供微服务支持，实现服务中间件、熔断器、远程调用器、调度器等， 底层 RPC 使用 Hprose 实现，支持 HTTP 或 Socket 协议（推荐 HTTP）， 客户端与服务端传输使用对称加密以保证数据安全

安装
--

[](#安装)

> 拓展包尚未在 composer packagist 中发布，安装方式采用本地安装

- 请将拓展包克隆到项目的相近目录

```
git clone git@xxx
```

- 将拓展包的相对路径（或绝对路径）配置到项目的 composer.json 中

```
composer config repositories.laravel-micro-service path ../../../laravel-micro-service
```

安装拓展包

```
$ composer require gzoran/laravel-micro-service:dev-master
```

发布配置文件
------

[](#发布配置文件)

以下命令将会把配置文件 microservice.php 发布到 config 目录

```
php artisan vendor:publish --provider="Gzoran\LaravelMicroService\LaravelMicroServiceProvider"
```

设置服务中心
------

[](#设置服务中心)

> 只有设置服务中心之后，你的服务才能正确发布到服务中心，客户端才能正确的找到服务端节点

- 设置服务中心驱动默认使用配置项 default

```
···

'service_center_driver' => [
    // 默认使用
    'default' => env('MICRO_SERVICE_SERVICE_CENTER_DRIVER_DEFAULT', 'local'),
    // 本地驱动
    'local' => \Gzoran\LaravelMicroService\Clients\ServiceCenterDrivers\LocalServiceCenterDriver::class,
    // 远程驱动
    'remote' => \Gzoran\LaravelMicroService\Clients\ServiceCenterDrivers\RemoteServiceCenterDriver::class,
],

···
```

- 当你使用 local 驱动时，则代表服务端节点列表将在你的配置文件中读取，请根据项目环境配置好服务端节点（server\_nodes）配置项

```
···

'server_nodes' => [

    ···

    // 开发环境
    'local' => [
        [
            // 服务端名称
            'server_name' => 'demo_server',
            // 节点列表
            'nodes' => [
                [
                    'scheme' => 'http', // 协议
                    'host' => 'www.demo.com', // 主机地址
                    'port' => 80, // 端口
                    'path' => 'rpc/demo-server', // 路径
                ],
            ],
        ],
    ],

    ···

],

···
```

- 当你使用 remote 驱动时，则代表服务端节点列表将在服务中心获取，请根据环境配置好服务中心节点（service\_center\_nodes）配置项

```
···

'service_center_nodes' => [

    ···

    // 开发环境
    'local' => [
        [
            'scheme' => 'http', // 协议
            'host' => 'www.demo.com', // 主机地址
            'port' => 80, // 端口
            'path' => 'rpc/demo-server', // 路径
        ],
    ],

    ···

],

···
```

目录
--

[](#目录)

- [服务端（Server）](./docs/Server.md)
- [客户端（Client）](./docs/Client.md)
- [命令行（Command）](./docs/Command.md)

License
-------

[](#license)

MIT

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Every ~4 days

Total

2

Last Release

2183d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e8901086f6184d56831163cf67c5de214e089ef86b774fd9b7927e81eaea92b?d=identicon)[sea24](/maintainers/sea24)

---

Top Contributors

[![huang-zhuohui](https://avatars.githubusercontent.com/u/34882179?v=4)](https://github.com/huang-zhuohui "huang-zhuohui (1 commits)")

### Embed Badge

![Health badge](/badges/xpx-laravel-micro-service/health.svg)

```
[![Health](https://phpackages.com/badges/xpx-laravel-micro-service/health.svg)](https://phpackages.com/packages/xpx-laravel-micro-service)
```

###  Alternatives

[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)[ecotone/laravel

Laravel integration for Ecotone

21307.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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