Green Framework Skeleton

Maintainers

Package info

github.com/YasserElgammal/green

Type:project

pkg:composer/yasser-elgammal/green

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 16

Open Issues: 0

v1.6.0 2026-05-23 18:50 UTC

This package is not auto-updated.

Last update: 2026-05-23 18:52:03 UTC


README

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.

⚡ Quick Start

1. Installation

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

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

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

📖 Master Documentation

The framework is divided into several powerful subsystems. Please refer to the Master Documentation for detailed guides on:

🛠 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 & 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.

📜 License

Green Framework is open-sourced under the MIT License.