A Modern PHP Platform. Not Just a Framework.
Attribute-first architecture, compiled infrastructure, PSR-aligned internals, first-party auth & security, and a unique AI orchestration engine — all delivered through a modular 26-package ecosystem.
What Defines MonkeysLegion v2
Not a minimal micro-framework. Not a legacy enterprise stack. A modern PHP application platform.
PHP 8.4 Baseline
Property hooks and strict typing are first-class design inputs, not future compatibility goals. Every package targets PHP 8.4+.
Attribute-First Architecture
Routes, validation, providers, listeners, and commands live next to the code they control — no YAML, no route files, no registration layers.
Compiled Container & Config
Autowiring in dev, compiled static PHP arrays in production. Zero runtime reflection, zero parsing overhead.
PSR-Aligned Internals
PSR-7, 11, 14, 15, 16, and 17 are part of the architecture. Replacement and modular adoption stay easy.
Integrated Security & Auth
JWT, OAuth2, TOTP 2FA, RBAC, rate limiting, CSRF, CORS, security headers — first-party, not scattered across packages.
AI-Native Direction
Apex is a full orchestration layer — multi-provider routing, schemas, pipelines, crews, guardrails, budgeting, and MCP support.
Architecture at a Glance
Convention-based discovery, compiled configuration, and a clear separation of concerns.
How it works
- Controllers & DTOs are discovered automatically via attributes
- Configuration lives in .mlc files with typed parsing and caching
- Templates compile to optimized PHP under resources/views
- Migrations are generated into var/migrations from entity diffs
- Runtime artifacts compile into cache directories for zero-overhead production.
The Package Ecosystem
MonkeysLegion isn't a monolith. It's built from 26 independently-versioned packages that compose beautifully together.
Apex AI
First-party AI orchestration, agent crews, and tool calling built directly into the framework.
Auth & Security
JWT, OAuth2, TOTP 2FA, API keys, RBAC, and Argon2id out of the box.
Core & Router
Attribute-based HTTP routing, compiled DI, and rapid boot lifecycle.
Get everything with one command
The Request Pipeline
Every HTTP request flows through a PSR-15 middleware stack before reaching your controller.
Benchmarked, not marketed.
All numbers produced on Apple Silicon with PHP 8.5.3, no opcache preloading, warm JIT, identical test harnesses.