PHPackages                             scil/laravel-fly - 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. scil/laravel-fly

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

scil/laravel-fly
================

make laravel faster by using swoole extension.

v0.16.6(6y ago)45249240[1 issues](https://github.com/scil/LaravelFly/issues)1MITPHP

Since Mar 11Pushed 1y ago23 watchersCompare

[ Source](https://github.com/scil/LaravelFly)[ Packagist](https://packagist.org/packages/scil/laravel-fly)[ Docs](http://www.github.com/scil/laravel_fly)[ RSS](/packages/scil-laravel-fly/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (11)Versions (30)Used By (1)

Please refer to [Swoole handles multiple requests simultaneously per-worker](https://github.com/nextcloud/server/issues/36290#issuecomment-1555965453) and [Hola FrankenPHP! Laravel Octane Servers Comparison](https://medium.com/beyn-technology/hola-frankenphp-laravel-octane-servers-comparison-pushing-the-boundaries-of-performance-d3e7ad8e652c)

====

Would you like php 7.4 Preloading? Would you like php coroutine? Today you can use them with Laravel because of Swoole. With LaravalFly, Laravel will begin like Django 3.0 to be fully async-capable.

LaravelFly is a safe solution to speeds up new or old Laravel 5.5+ projects, with preloading and coroutine, while without data pollution or memory leak. And it makes Tinker available online (use tinker while Laravel is responding requests from browsers).

Thanks to [Laravel](http://laravel.com/), [Swoole](https://github.com/swoole/swoole-src) and [PsySh](https://github.com/bobthecow/psysh).

**Notice**: Great News! [Laravel is supporting Swoole offcially with laravel/octane!](https://github.com/laravel/octane)

A simple ab test
----------------

[](#a-simple-ab-test)

`ab -k -n 1000 -c 10 http://zc.test` (21 sql statements were executed in single request)

.fpmFlyTime taken ≈43.5 s12.3 sRequests per second2381.550%303 ms117 ms80%360 ms153 ms99%1341 ms239 msTest Env- env:
    - ubuntu 16.04 on VirtualBox ( 1 CPU: i7-7700HQ 2.80GHz ; Memory: 2G )
    - php7.2 + opcache + 5 workers for both fpm and laravelfly ( phpfpm : pm=static pm.max\_children=5)
    - connection pool and coroutine mysql
- Test date : 2018/10

Version Compatibility
---------------------

[](#version-compatibility)

- Laravel 5.5 ~ 6.0
- Swoole &gt;4.2.13

Quick Start
-----------

[](#quick-start)

1.`pecl install swoole`
Make sure `extension=swoole.so` in config file for php cli, not for fpm.
Suggest: `pecl install inotify`

2.`composer require "scil/laravel-fly":"dev-master"`

3.`php vendor/scil/laravel-fly/bin/fly start`
If you enable `eval(tinker())` and see an error about mkdir, you can start LaravelFly with sudo.

Now, your project is flying and listening to port 9501. Enjoy yourself.

Docker-compose
--------------

[](#docker-compose)

```
composer require "scil/laravel-fly":"dev-master"

php artisan vendor:publish --tag=fly-server

# 127.0.0.1:8080
# you can edit this docker-compos file and use your own nginx conf
docker-compose -f vendor/scil/laravel-fly-local/docker/docker-compose.yml up -d

```

Doc
---

[](#doc)

[Configuration](https://github.com/scil/LaravelFly/wiki/Configuration)

[Commands: Start, Reload &amp; Debug](https://github.com/scil/LaravelFly/wiki/Commands)

[Coding Guideline](https://github.com/scil/LaravelFly/wiki/Coding-Requirement)

[Events about LaravelFly](doc/events.md)

[Using tinker when Laravel Working](doc/tinker.md)

[For Dev](doc/dev.md)

Recommended Packages
--------------------

[](#recommended-packages)

- [swlib/saber](https://github.com/swlib/saber/blob/master/README-EN.md) Coroutine HTTP client, based on `Swoole\Coroutine\Http\Client`.
    Browser-like cookie managment, multiple requests concurrent, request/response interceptors and so on.
    To ensure safety, set `const LARAVELFLY_COROUTINE = true;` in fly.conf.php.

Features and Behaviors
----------------------

[](#features-and-behaviors)

- Same codes can run on PHP-FPM or LaravelFly. LaravelFly can be installed on your existing projects without affecting nginx/apache server, that's to say, you can run LaravelFly server and nginx/apache server simultaneously to run the same laravel project. The nginx conf [swoole\_fallback\_to\_phpfpm.conf](config/swoole_fallback_to_phpfpm.conf) allow you use LaravelFlyServer as the primary server, and the phpfpm as a backup server which will be passed requests when the LaravelFlyServer is unavailable. Another nginx conf [use\_swoole\_or\_fpm\_depending\_on\_clients](config/use_swoole_or_fpm_depending_on_clients.conf) allows us use query string `?useserver=connections[$childId] = [];` in ConnectionsTrait.php
- swoole redis driver
- swoole redis driver: how to use `errMsg` `errCode`
- use [hyperf/database](https://github.com/hyperf/database) to replace official version?
- use [swlib/swpdo](https://github.com/swlib/swpdo) to replace SwoolePDO?
- Cache for HasRelationships. disable and experimental, not ready
- Cache for RouteDependencyResolverTrait
- Converting between swoole request/response and Laravel Request/Response
- safe: auth, remove some props?
- use:
- use:  or

Other Todo
----------

[](#other-todo)

- add events
- watch code changes and hot reload
- supply server info. default url is: /laravel-fly/info
- function fly()
- job executed in task process. Related: vendor\\scil\\laravel-fly-files-local\\src\\Foundation\\Bus\\
- event listeners executed in task process. Related: LaravelFly\\Map\\IlluminateBase\\Dispatcher and vendor\\scil\\laravel-fly-files\\src\\Foundation\\Support\\Providers\\EventServiceProvider.php
- use $this-&gt;output instead of echo() in Common.php
- bootstrap all service providers in task process
- try ocramius/generated-hydrator for laravel-fly/info when its version 3 is ready (it will require nikic/php-parser v4 which is needed by others) // or Zend\\Hydrator\\Reflection?
- add tests about auth SessionGuard: Illuminate/Auth/SessionGuard.php with uses Request::createFromGlobals
- add tests about uploaded file, related symfony/http-foundation files: File/UploadedFile.php and FileBag.php(fixPhpFilesArray)
- websocket
- send file
- travis, static analyze like phan, phpstan or
- cache fly

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 99.7% 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 ~22 days

Total

29

Last Release

2353d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f55c58baf3717e5aa4ec9ed3dc8770124a391975b72216c5e57d30fbf3b82f3?d=identicon)[scil](/maintainers/scil)

---

Top Contributors

[![scil](https://avatars.githubusercontent.com/u/2786775?v=4)](https://github.com/scil "scil (666 commits)")[![fridzema](https://avatars.githubusercontent.com/u/8180660?v=4)](https://github.com/fridzema "fridzema (1 commits)")[![stevenyangecho](https://avatars.githubusercontent.com/u/5569554?v=4)](https://github.com/stevenyangecho "stevenyangecho (1 commits)")

---

Tags

laravelspeedswooletinkerlaravelswoole

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/scil-laravel-fly/health.svg)

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

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4205.3M84](/packages/livewire-volt)[garveen/laravoole

Get 10x performance for Laravel on Swoole or Workerman

8834.9k](/packages/garveen-laravoole)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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