PHPackages                             jyj1993126/laravoole - 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. jyj1993126/laravoole

ActiveLibrary[Framework](/categories/framework)

jyj1993126/laravoole
====================

Get 10x performance for Laravel on Swoole or Workerman

0.2.2(9y ago)018MITPHPPHP &gt;=5.5.16

Since Nov 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jyj1993126/laravoole)[ Packagist](https://packagist.org/packages/jyj1993126/laravoole)[ RSS](/packages/jyj1993126-laravoole/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (18)Used By (0)

\#Laravoole

Laravel on Swoole Or Workerman

10x faster than php-fpm

\##Depends On

  php&gt;=5.5.16   laravel/framework5.1.\* | 5.2.\* | 5.3.\* \##Suggests

  php&gt;=7.0.0   ext-swoole&gt;=1.7.21   workerman/workerman&gt;=3.0 \##Install

To get started, add laravoole to you composer.json file and run `composer update`:

```
"garveen/laravoole": "~0.2"

```

or just run shell command:

```
 composer require garveen/laravoole
```

Once composer done its job, you need to register Laravel service provider, in your config/app.php:

```
'providers' => [
    ...
    Laravoole\LaravooleServiceProvider::class,
],

```

**Notice: You should NOT use file session handler, because it is not stable at this environement. Use redis or other handler instead.**

\##Usage

```
php artisan laravoole [start | stop | reload | reload_task | restart | quit]
```

\##Config

To generate `config/laravoole.php`:

```
php artisan vendor:publish --provider="Laravoole\LaravooleServiceProvider"
```

Most of things can be configured with `.env`, and you should use `LARAVOOLE_{UPPER_CASE}` format, for example,

```
[
    'base_config' => [
        'host' => '0.0.0.0',
    ]
]
```

is equals with

```
LARAVOOLE_HOST=0.0.0.0
```

\##base\_config

This section configures laravoole itself.

\###mode

`SwooleHttp` uses swoole to response http requests

`SwooleFastCGI` uses swoole to response fastcgi requests (just like php-fpm)

`SwooleWebSocket` uses swoole to response websocket requests **AND** http requests

`WorkermanFastCGI` uses workerman to response fastcgi requests (just like php-fpm)

\###pid\_file

Defines a file that will store the process ID of the main process.

\###deal\_with\_public

When using Http mode, you can turn on this option to let laravoole send static resources to clients. Use this ***ONLY*** when developing.

\###host and port

Default `host` is `127.0.0.1`, and `port` is `9050`

\##handler\_config

This section configures the backend, e.g. `swoole` or `workerman`.

\###Swoole

As an example, if want to set worker\_num to 8, you can set `.env`:

```
 LARAVOOLE_WORKER_NUM=8
```

or set `config/laravoole.php`:

```
[
    'handler_config' => [
        'worker_num' => 8,
    ]
]
```

See Swoole's document:

[简体中文](http://wiki.swoole.com/wiki/page/274.html)

[English](https://cdn.rawgit.com/tchiotludo/swoole-ide-helper/dd73ce0dd949870daebbf3e8fee64361858422a1/docs/classes/swoole_server.html#method_set)

\###Workerman

As an example, if want to set worker\_num to 8, you can set `.env`:

```
 LARAVOOLE_COUNT=8
```

or set `config/laravoole.php`:

```
[
    'handler_config' => [
        'count' => 8,
    ]
]
```

See Workerman's document:

[简体中文](http://doc3.workerman.net/worker-development/property.html)

[English](http://wiki.workerman.net/Workerman_documentation#Properties)

\##Websocket Usage

\###Subprotocols

See Mozilla's Document: [Writing WebSocket server](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols)

The default subprotocol is [jsonrpc](http://json-rpc.org/), but has some different: `params` is an object, and two more properties:

`status` as HTTP status code

`method` is the same as request's method

You can define your own subprotocol, by implements `Laravoole\WebsocketCodec\CodecInterface` and add to `config/laravoole.php`.

\###Client Example:

```
>

WebSocket Test

p{word-wrap: break-word;}
tr:nth-child(odd){background-color: #ccc}
tr:nth-child(even){background-color: #eee}

WebSocket Test

    var wsUri = "ws://localhost:9050/websocket";
    var protocols = ['jsonrpc'];
    var output = document.getElementById("output");

    function send(message) {
        websocket.send(message);
        log('Sent', message);
    }

    function log(type, str) {
        str = str.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(//g, '&gt;');
        output.insertAdjacentHTML('beforeend', '' + type + '' + htmlEscape(str) + '');
    }

    websocket = new WebSocket(wsUri, protocols);
    websocket.onopen = function(evt) {
        log('Status', "Connection opened");
        send(JSON.stringify({method: '/', params: {hello: 'world'},  id: 1}));
        setTimeout(function(){ websocket.close() },1000)
    };
    websocket.onclose = function(evt) { log('Status', "Connection closed") };
    websocket.onmessage = function(evt) { log('Received', evt.data) };
    websocket.onerror = function(evt) {  log('Error', evt.data) };

```

\##Work with nginx

```
server {
    listen       80;
    server_name  localhost;

    root /path/to/laravel/public;

    location / {
            try_files $uri $uri/ @laravoole;
            index  index.html index.htm index.php;
        }

    # http
    location @laravoole {
        proxy_set_header   Host $host:$server_port;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;

        proxy_pass http://127.0.0.1:9050;
    }

    # fastcgi
    location @laravoole {
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9050;
    }

    # websocket
    # send close if there has not an upgrade header
    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }
    location /websocket {
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
        proxy_pass http://127.0.0.1:9050;
        proxy_http_version 1.1;
        proxy_set_header Upgrade    $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}
```

\#License [MIT](LICENSE)

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% 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 ~29 days

Recently: every ~80 days

Total

13

Last Release

3508d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.5.9

0.1.9PHP &gt;=5.5.16

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6315451?v=4)[Leon J](/maintainers/jyj1993126)[@jyj1993126](https://github.com/jyj1993126)

---

Top Contributors

[![garveen](https://avatars.githubusercontent.com/u/3214266?v=4)](https://github.com/garveen "garveen (72 commits)")[![denghongcai](https://avatars.githubusercontent.com/u/1433247?v=4)](https://github.com/denghongcai "denghongcai (6 commits)")

---

Tags

laravelswooleworkerman

### Embed Badge

![Health badge](/badges/jyj1993126-laravoole/health.svg)

```
[![Health](https://phpackages.com/badges/jyj1993126-laravoole/health.svg)](https://phpackages.com/packages/jyj1993126-laravoole)
```

###  Alternatives

[laravel/octane

Supercharge your Laravel application's performance.

4.0k24.7M205](/packages/laravel-octane)[unopim/unopim

UnoPim Laravel PIM

10.5k2.2k](/packages/unopim-unopim)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21313.7k3](/packages/ecotone-laravel)[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.

3911.7k](/packages/codewithdennis-larament)[r2luna/brain

Brain: A process-driven architecture alternative for your Laravel Application.

6333.0k1](/packages/r2luna-brain)

PHPackages © 2026

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