PHPackages                             betoalien/lyger - 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. betoalien/lyger

ActiveProject[Framework](/categories/framework)

betoalien/lyger
===============

Lyger Framework v0.1 - PHP on steroids with Rust FFI

1001PHPCI passing

Since Mar 14Pushed 1mo agoCompare

[ Source](https://github.com/betoalien/Lyger-PHP-Framework)[ Packagist](https://packagist.org/packages/betoalien/lyger)[ RSS](/packages/betoalien-lyger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

⚡ Lyger Framework
=================

[](#-lyger-framework)

**The PHP framework that never sleeps.**

A high-performance PHP 8.0+ framework powered by a Rust FFI backend. Always-Alive workers. Zero-Copy data. Zero-Bloat installation.

[![PHP 8.0+](https://camo.githubusercontent.com/423698a15c259fe99627b4ab8328a052b729761f9c4b01dafc58b699b85f352b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php.net)[![Rust](https://camo.githubusercontent.com/35425d5ea2ba7db9eb90449e5d736072569f1695fc0bb5b4f5c6b892dfa2cd4e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323062792d527573742d4345343232423f7374796c653d666c61742d737175617265266c6f676f3d72757374266c6f676f436f6c6f723d7768697465)](https://www.rust-lang.org)[![License: MIT](https://camo.githubusercontent.com/2064788fb84458d8ff362f54c72f9e243482923edc86c7959056107df445aca7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d3232633535653f7374796c653d666c61742d737175617265)](LICENSE)![Version](https://camo.githubusercontent.com/b3afc3de71495889b360e03a43c46ab8c5f4109d8d066f43d94760b005e287c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d302e312d3362383266363f7374796c653d666c61742d737175617265)

[📖 Documentation](https://betoalien.github.io/Lyger-PHP-Framework/) · [🚀 Quick Start](#quick-start) · [📊 Benchmarks](#performance) · [🎯 Demo](https://github.com/betoalien/Lyger-PHP-v0.1-Dental-Clinic-Demo)

---

What makes Lyger different?
---------------------------

[](#what-makes-lyger-different)

Traditional PHP frameworks die and restart on every request. Lyger doesn't.

```
Laravel / Symfony                    Lyger
─────────────────                    ──────────────────────────────────
Request → Boot PHP    (50-200ms)     Request → Rust HTTP Server (Axum)
        → Load 500+ files                    → PHP Worker (already loaded)
        → Register services                  → Execute logic only
        → Handle request                     → Return response
        → Die
        → Repeat forever

```

Lyger keeps PHP **always alive in memory** and routes requests through a native **Rust HTTP server**. Database queries run through a **Zero-Copy FFI bridge** — results stay in Rust memory, PHP never touches the raw bytes.

---

Performance
-----------

[](#performance)

> Real benchmarks. Same hardware. Same workload.

OperationLygerLaravelSymfonyAdvantageDatabase CRUD (1 000 ops)**1.09 ms**342.61 ms340.92 ms**313×**JSON Serialization (1 000 obj)**6.62 ms**17.24 ms17.67 ms**3×**Heavy Computation (10M iter)**112 ms**360 ms357 ms**3.2×**Throughput (Hello World)**139M req/s**123M req/s110M req/s**+13%**The 313× database advantage comes from bypassing PDO entirely — Rust's `tokio-postgres` and `mysql_async` handle queries asynchronously, and results never leave Rust's heap until you need the final JSON.

---

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

[](#quick-start)

### Requirements

[](#requirements)

- PHP 8.0+ with `ffi` extension
- Composer

### Install

[](#install)

**Via Composer (recommended):**

```
composer create-project betoalien/lyger my-app
cd my-app
```

**Via Git:**

```
git clone https://github.com/betoalien/Lyger-PHP-Framework.git my-app
cd my-app
composer install
```

Enable FFI in `php.ini`:

```
ffi.enable = 1
```

### Setup (Zero-Bloat installer)

[](#setup-zero-bloat-installer)

```
php rawr install
```

The interactive installer removes every module you don't need — leaving only the code your project actually uses.

```
? Architecture   →  API Headless  |  Full-Stack
? Frontend       →  Vue.js  |  React  |  Svelte
? Database       →  SQLite  |  PostgreSQL  |  MySQL
? Auth           →  Session  |  JWT  |  None

```

### Start the server

[](#start-the-server)

```
php rawr serve          # Always-Alive mode (Rust HTTP server)
php rawr serve:php      # PHP built-in server (fallback)
```

Visit `http://localhost:8000`

---

Your first route
----------------

[](#your-first-route)

```
// routes/web.php
use Lyger\Routing\Route;
use Lyger\Http\Response;

Route::get('/api/users', function () {
    $users = User::all();
    return Response::json($users->toArray());
});

Route::post('/api/users/{id}', [UserController::class, 'update']);
```

---

Core features
-------------

[](#core-features)

FeatureDescription**Always-Alive Worker**PHP stays loaded in memory — zero restart overhead per request**Rust FFI Bridge**Native Rust library for HTTP, DB, cache, and computation**Zero-Copy Database**Query results live in Rust memory; PHP holds an opaque pointer**Eloquent-style ORM**`find()`, `all()`, `create()`, relationships, timestamps, soft deletes**Reflection-based DI**Constructor dependencies resolved automatically — no manual wiring**Fluent Query Builder**`where()`, `join()`, `paginate()`, `orderBy()` — all chainable**Validation**20+ built-in rules, custom messages, Form Request classes**In-memory Cache**TTL, `remember()`, locks — Redis-like, zero dependencies**Event System**Dispatch, wildcard listeners, broadcast channels**Job Queue**Persistent async jobs, retries, `Dispatchable` trait**API Resources**`ApiResponse`, `JsonResource`, `ApiController` base class**Schema &amp; Migrations**Fluent `Blueprint`, `migrate` / `rollback` / `status`**Testing Framework**`TestCase` + `HttpTestCase` — no PHPUnit required**Zero-Bloat Install**Unused code physically deleted after interactive setup---

CLI reference
-------------

[](#cli-reference)

```
php rawr serve                       # Start Always-Alive Rust server
php rawr serve --port=8080           # Custom port
php rawr serve:php                   # PHP built-in server fallback

php rawr make:controller Name        # Generate controller
php rawr make:model Name             # Generate model
php rawr make:model Name --migration # Generate model + migration
php rawr make:migration Name         # Generate migration file
php rawr make:auth                   # Auth scaffolding
php rawr make:dash                   # Admin dashboard

php rawr migrate                     # Run pending migrations
php rawr migrate:rollback            # Rollback last batch
php rawr migrate:status              # Show migration status
```

---

Documentation
-------------

[](#documentation)

📖 **GitHub Pages**[betoalien.github.io/Lyger-PHP-Framework](https://betoalien.github.io/Lyger-PHP-Framework/)🌐 **Mintlify Docs**[betoalien-lyger-php-framework.mintlify.app/introduction](https://betoalien-lyger-php-framework.mintlify.app/introduction)---

Live demo
---------

[](#live-demo)

```
git clone https://github.com/betoalien/Lyger-PHP-v0.1-Dental-Clinic-Demo.git
cd Lyger-PHP-v0.1-Dental-Clinic-Demo
composer install
php rawr serve
```

---

Architecture overview
---------------------

[](#architecture-overview)

```
                    ┌──────────────────────────────┐
  HTTP Requests ──▶ │   Rust Axum HTTP Server      │  Native I/O
                    └──────────────┬───────────────┘
                                   │ FFI callback
                    ┌──────────────▼───────────────┐
                    │   PHP Worker (Always-Alive)   │  Zero restart
                    │   Router · DI · ORM · Cache   │
                    └──────────────┬───────────────┘
                                   │ FFI call
                    ┌──────────────▼───────────────┐
                    │   Rust Tokio Runtime          │  Async I/O
                    │   tokio-postgres · mysql_async│
                    │   Result: opaque u64 pointer  │  Zero-Copy
                    └──────────────────────────────┘

```

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance59

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 94.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/981e0e37ef213beecb4a9446a1e452ff012409ca37bf971e2689c7e4736d5742?d=identicon)[betoalien](/maintainers/betoalien)

---

Top Contributors

[![betoalien](https://avatars.githubusercontent.com/u/13228007?v=4)](https://github.com/betoalien "betoalien (17 commits)")[![colshrapnel](https://avatars.githubusercontent.com/u/2895470?v=4)](https://github.com/colshrapnel "colshrapnel (1 commits)")

---

Tags

phprustrust-lang

### Embed Badge

![Health badge](/badges/betoalien-lyger/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M256](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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