PHPackages                             yasser-elgammal/green - 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. yasser-elgammal/green

ActiveProject[Framework](/categories/framework)

yasser-elgammal/green
=====================

Green Framework Skeleton

v2.1.0(6d ago)1812↓92.3%1MITPHPPHP ^8.2

Since Apr 5Pushed 3w agoCompare

[ Source](https://github.com/YasserElgammal/green)[ Packagist](https://packagist.org/packages/yasser-elgammal/green)[ RSS](/packages/yasser-elgammal-green/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (13)Versions (17)Used By (0)

🌿 Green Framework
=================

[](#-green-framework)

**Green** is a lightweight, modern PHP framework built with PHP 8.2+ features, focusing on simplicity, speed, and developer experience. It leverages **PHP Attributes** for routing and follows a **Table Gateway** architecture.

> **Note:** This repository contains the **application skeleton**. The core framework engine is located at [YasserElgammal/green-core](https://github.com/YasserElgammal/green-core).

---

⚡ Quick Start
-------------

[](#-quick-start)

### 1. Installation

[](#1-installation)

```
composer create-project yasser-elgammal/green app-name
cd app-name
cp .env.example .env
php green serve
```

### 2. Define a Route

[](#2-define-a-route)

```
class PostController {
    #[Route('GET', '/posts/{id}', middleware: [AuthMiddleware::class, LocaleMiddleware::class])]
    public function show(int $id) {
        return view('posts/show', ['id' => $id]);
    }
}
```

Pass route middleware as an array; add multiple middleware classes in the order they should run.

### 3. Database Access

[](#3-database-access)

```
$posts = new PostTable();
$post  = $posts->fetchById(1);
```

---

📖 Master Documentation
----------------------

[](#-master-documentation)

The framework is divided into several powerful subsystems. Please refer to the **[Master Documentation](DOCUMENTATION.md)** for detailed guides on:

- **[Core Architecture](DOCUMENTATION.md#-1-core-architecture)**: Lifecycle and DI patterns.
- **[Routing &amp; Middleware](DOCUMENTATION.md#-2-routing--middleware)**: Attribute-based routing and pipelines.
- **[Database &amp; Relations](DOCUMENTATION.md#-3-database--table-gateway--models)**: Eager loading and Table Gateways.
- **[API Layer](DOCUMENTATION.md#-4-api-layer-transformers--pagination)**: Smart Transformers and Pagination.
- **[Logic &amp; Validation](DOCUMENTATION.md#-5-logic-payloads--validation)**: Payload-based validation.
- **[Security &amp; Sessions](DOCUMENTATION.md#-6-security--sessions)**: State management and hashing.
- **[Global Exception Handling](DOCUMENTATION.md#-7-exception-handling--debug-mode)**: Debug Mode and API errors.
- **[Debugging with `leaf()`](DOCUMENTATION.md#73-debugging-with-leaf)**: Native PHP helper for dumping a value and stopping execution.
- **[Helper Reference](DOCUMENTATION.md#-8-helper-reference-cheat-sheet)**: Glossary of global functions.
- **[Console Commands](DOCUMENTATION.md#-9-console-commands)**: CLI tools and generators.
- **[Migrations &amp; Schema Builder](DOCUMENTATION.md#-10-migrations--schema-builder)**: Migration workflow, schema operations, dry-run mode, and safe mode.
- **[Translation &amp; Localization](DOCUMENTATION.md#-11-translation--localization)**: Global helpers, multiple providers, caching, and pluralization.
- **[Include Query Language](DOCUMENTATION.md#-12-include-query-language-iql)**: Advanced relation loading with limits, ordering, filtering, and column selection.
- **[Connect](DOCUMENTATION.md#13-connect-external-http-apis)**: Outgoing HTTP requests for third-party APIs and services.

---

🛠 Features at a Glance
----------------------

[](#-features-at-a-glance)

- ✅ **PHP 8.2+ Attributes**: No more clunky routing files.
- ✅ **Table Gateway**: Clean separation of state (Model) and logic (Table).
- ✅ **Eager Loading &amp; IQL**: Simple `include('relation')` to solve N+1, with an advanced query language for limits, ordering, filtering, and column selection.
- ✅ **Smart Transformers**: Nested API responses made easy.
- ✅ **Auto-Validation**: Type-hint payloads for instant validation.
- ✅ **Twig Templates**: Native Twig integration for clean views.
- ✅ **Connect**: Simple outgoing HTTP requests for payments, CRMs, messaging APIs, and other services.
- ✅ **Debug UI**: Premium dark-mode error pages.
- ✅ **`leaf()` Debugging**: Native formatted dump-and-die output for focused PHP debugging.

---

Contributing
------------

[](#contributing)

Contributions are welcome. Please read the [Contributing Guide](CONTRIBUTING.md) before opening an issue or pull request.

---

📜 License
---------

[](#-license)

Green Framework is open-sourced under the [MIT License](LICENSE).

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance97

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~6 days

Total

15

Last Release

6d ago

Major Versions

v1.9.0 → v2.0.02026-06-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/35766609?v=4)[Yasser Elgammal](/maintainers/YasserElgammal)[@YasserElgammal](https://github.com/YasserElgammal)

---

Top Contributors

[![YasserElgammal](https://avatars.githubusercontent.com/u/35766609?v=4)](https://github.com/YasserElgammal "YasserElgammal (41 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yasser-elgammal-green/health.svg)

```
[![Health](https://phpackages.com/badges/yasser-elgammal-green/health.svg)](https://phpackages.com/packages/yasser-elgammal-green)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M889](/packages/laravel-socialite)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.5k91.9M595](/packages/laravel-passport)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.1k](/packages/typo3-cms-core)[gemvc/library

Server Agnostic (openSwoole/Nginx/Apache) Rest Api Microservice ready Framework/Library

221.4k](/packages/gemvc-library)[forumify/forumify-platform

122.0k14](/packages/forumify-forumify-platform)

PHPackages © 2026

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