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 28 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.
| Operation | MonkeysLegion Ops/sec | vs Laravel | vs Symfony |
|---|---|---|---|
| Entity creation | 0.0M | ~140× faster | ~114× faster |
| DTO construction | 0.0M | ~60× faster | ~54× faster |
| Resource serialization | 0.0K | ~5.5× faster | ~3.6× faster |
| Enum operations | 0.0M | ~25× faster | ~22× faster |
| Property hooks (email) | 0.0M | N/A | N/A |
| Computed properties | 0M | N/A | N/A |
| Peak memory (cold boot) | 0MB | ≈ 22 MB | ≈ 14 MB |
Why we win
- 01Zero-magic architecture — Entities, DTOs, and enums are plain PHP objects.
- 02PHP 8.4 property hooks — Validation and formatting run as native engine hooks.
- 03No ORM hydration overhead — Entities are POPOs. No Doctrine or Eloquent proxies.
- 04Attribute routing — Compiled once at cache time. No regex matching at runtime.
- 05Lean PSR-15 pipeline — ~12.5K req/s HTTP throughput vs Laravel's ~2.1K req/s.
Great frameworks, different trade-offs
Laravel built an incredible ecosystem — Forge, Vapor, Nova, Cashier — and the largest PHP community. If you need a batteries-included SaaS starter, it's hard to beat.
Symfony powers some of the most mission-critical enterprise systems on earth. Its profiler, debug toolbar, and rigorous release cycle are best-in-class.
MonkeysLegion is built for a different moment: when you need raw throughput, zero-magic PHP 8.4+ code, and a framework that gets out of your way. No 22 MB boot. No runtime proxies. Just your code.