📦 Marketplace⭐ GitHub
monkeyslegion@2.0PHP 8.4+PSR-compliant

Every feature. Deep dive.

Nineteen capabilities. One composer install. Attribute routing, compiled DI, authentication, validation, caching, events, queues, mail, telemetry, OpenAPI, CLI — everything an app needs, nothing it doesn't.

HTTP & Routing

🧭

Attribute Routing

monkeyslegion-router@2.1

Define routes where your handlers live.

php
#[Route('/api/users', name: 'users')]
final class UserController
{
    #[Get('/{id:\\d+}', name: 'show', tags: ['Users'])]
    public function show(int $id): ResponseInterface { }
}
🛡️

Security Middleware

monkeyslegion-http@2.0

OWASP headers, CORS, CSRF, rate limiting, trusted proxy — all PSR-15, all enabled by default. Not "secure once you install five packages."

php
// Default stack: SecurityHeaders → TrustedProxy
//   → RequestId → CORS → RateLimit
//   → Session → CSRF → Auth → Router

Auth & Security

🔐

Authentication Suite

monkeyslegion-auth@2.1

The entire authentication lifecycle. In one package. JWT, OAuth2, TOTP 2FA, API keys, RBAC, policies, Argon2id — not as separate add-ons.

php
$result = $authService->login([
    'email'    => 'user@example.com',
    'password' => 'secret',
]);

if ($result->requires2FA) {
    return json_response(['challenge' => $result->challengeToken]);
}
$tokens = $result->getTokens();

Validation & DTOs

monkeyslegion-validation@2.0

Type-safe requests. Zero boilerplate. Annotate DTO properties with validation attributes. Invalid input never reaches your controller.

php
final readonly class CreateUserRequest
{
    public function __construct(
        #[Assert\NotBlank, Assert\Email]
        public string $email,
        #[Assert\Length(min: 8, max: 64)]
        public string $password,
    ) {}
}

Data Layer

🗄️

Database & QueryBuilder

monkeyslegion-database@2.0

PDO, but modern. A connection manager, fluent builder, and entity scanner. No ORM magic, no hydration tax, no Doctrine proxies.

php
$users = $qb->select(['id', 'name', 'email'])
    ->from('users')
    ->where('status', '=', 'active')
    ->orderBy('created_at', 'DESC')
    ->limit(10)
    ->get();
📋

Compiled DI Container

monkeyslegion-di@2.0

Zero runtime reflection. In production. Autowiring in dev, compiled static PHP array in production. One command flips the switch.

php
#[Provider(priority: 10, context: 'http')]
#[BootAfter(DatabaseProvider::class)]
final class PaymentProvider extends AbstractServiceProvider
{
    public function getDefinitions(): array { ... }
}

Templates & Assets

📝

Template Engine (MLView)

monkeyslegion-template@2.0

Familiar syntax. Compiled output. No surprises. Directives, layouts, inheritance — compiled to optimized PHP.

php
@extends('layouts.app')

@section('content')
    <h1>{{ $user->name }}</h1>
    @foreach($posts as $post)
        <article>{{ $post->title }}</article>
    @endforeach
@endsection
📁

File Management

monkeyslegion-files@2.0

Uploads, storage, and image processing. Unified. Local, S3, GCS through one interface. Garbage collection included.

php
$path = $files->store($upload, 'avatars', disk: 's3');
$thumb = $images->process($path, [
    'resize' => [150, 150],
    'format' => 'webp',
]);
return $files->url($path);

Background & Events

📡

Events (PSR-14)

monkeyslegion-events@2.0

Attribute-discovered listeners, priority ordering, wildcard subscriptions, queueable listeners.

php
#[Listener(event: UserRegistered::class, priority: 10)]
final class SendWelcomeEmail
{
    public function __invoke(UserRegistered $event): void
    {
        $this->mail->send($event->email, 'welcome');
    }
}
⚙️

Queue System

monkeyslegion-queue@1.2

Redis, database, or array drivers. Retry with exponential backoff, timeouts, batching, middleware.

php
$this->queue->push(new SendEmailJob($user->id, 'welcome'));
$this->queue->later(3600, new SendEmailJob($user->id, 'tips'));

# php ml queue:work --tries=3 --timeout=60

Operations & Observability

📊

Telemetry & Observability

monkeyslegion-telemetry@2.0

Prometheus metrics, distributed tracing (Jaeger/Tempo), structured logs — all wired by default.

php
$span = $this->tracer->startSpan('order.place');
$this->metrics->counter('orders_placed_total')->inc();
$this->metrics->histogram('order_amount_usd')->observe($total);
📖

OpenAPI v3

monkeyslegion-openapi@1.0

Routes + DTOs + return types = your API spec. No hand-maintained YAML, no doc rot.

php
#[Get('/', name: 'users.index',
    summary: 'List all users',
    tags: ['Users', 'API'],
)]
public function index(ListUsersQuery $query): UserCollection { }
⌨️

CLI Framework

monkeyslegion-cli@2.0

17+ scaffolders, DB migrations, queue workers, schedule runner, interactive REPL — one binary.

php
php ml make:controller User
php ml make:entity User
php ml migrate
php ml queue:work
php ml tinker
💬

I18n

monkeyslegion-i18n@2.1

File + database loaders, ICU-style plurals, nested keys, locale detection middleware.

php
echo $t->trans('messages.greeting', ['name' => 'John']);
// "Hello, John!"
echo $t->choice('messages.items', 5);
// "5 items"
📧

Mail

monkeyslegion-mail@1.1

SMTP + API transports, DKIM signing, template-backed mailables, queueable delivery.

php
$mailer->to($user->email)->send(new WelcomeMail($user));
$mailer->to($user->email)->queue(new WelcomeMail($user));
💾

Cache (PSR-16)

monkeyslegion-cache@2.0

Redis, file, Memcached, array. Tagging, locking, stampede protection, multi-store.

php
$result = $cache->remember('expensive', 3600,
    fn() => computeExpensive());
$cache->tags(['products'])->flush();

Ready to start?

Every feature above ships as one composer create-project command.

Ready to ship?

$composer create-project monkeyscloud/monkeyslegion-skeleton my-app
Framework home →Browse packages →Apex AI →