v2.0.0 — Composer Powered

NM Base
Framework

The framework, rebuilt on the shoulders of the ecosystem — Symfony HttpFoundation, Illuminate's Eloquent ORM, hardened cryptography and a full JWT toolchain, wired into the same clean MVC core.

Explore Architecture composer.json View File Tree GitHub Project Page
PHP 8.2 · Composer · Symfony · Illuminate · v2.0.0

// architecture

Core Modules

Same modular core, now backed by battle-tested packages instead of hand-rolled internals wherever it makes sense.

🔀

Routing & HTTP

Named routes compiled to regex, dispatched through Request/Response objects now built on Symfony HttpFoundation for a battle-tested HTTP layer.

Router.php Route.php symfony/http-foundation Request.php Response.php
🗄

ORM & Query Builder

Eloquent-style models, relationships and pagination powered by Illuminate Database, replacing the hand-written query builder.

illuminate/database illuminate/pagination BaseModel.php Migrator.php
🔐

Cryptography & Secrets

Modern authenticated encryption via Halite (libsodium) and defuse/php-encryption, with constant-time helpers to avoid timing attacks.

paragonie/halite defuse/php-encryption constant_time_encoding hidden-string
🪪

JWT & Auth Tokens

First-class JWT issuing and verification for stateless auth and APIs, combining two complementary libraries for signing and JWK/JWS/JWE support.

web-token/jwt-library firebase/php-jwt TokenGuard.php
🛡

Security & CSRF

CSRF token generation and validation delegated to Symfony Security CSRF, layered under the existing Authorization and Validator utilities.

symfony/security-csrf CSRF.php Authorization.php Validator.php

Validation

Declarative rule chains via Respect/Validation, plus RFC-compliant email checks that don't reject valid real-world addresses.

respect/validation egulias/email-validator
📡

HTTP Client & Logging

Outbound HTTP calls through Guzzle with retry/middleware support, structured logs written through a PSR-3 compliant Monolog stack.

guzzlehttp/guzzle monolog/monolog psr/log Log.php
📁

Filesystem & Assets

Filesystem operations and file discovery through Symfony Filesystem/Finder, with accurate MIME detection for uploads.

symfony/filesystem symfony/finder league/mime-type-detection
🌍

Config, Env & i18n

.env loading through phpdotenv, per-domain config files, and translation catalogs for multi-language responses.

vlucas/phpdotenv symfony/translation Environment.php Config.php
🧩

Container & Events

A PSR-11 compliant service container plus an Illuminate-backed event dispatcher for decoupled, listener-driven flows.

psr/container illuminate/events Container.php EventDispatcher.php

// composer.json

Dependencies

Every package pulled in on purpose — no dead weight, each one backs a module above.

composer.json / require
"php":"^8.2", // Minimum PHP runtime
"vlucas/phpdotenv":"*", // .env loading
"monolog/monolog":"^3.9", // PSR-3 structured logging
"guzzlehttp/guzzle":"*", // Outbound HTTP client
"symfony/var-dumper":"*", // Debug dumping
"symfony/http-foundation":"^7.3", // Request / Response abstraction
"psr/container":"^2.0", // Service container interface
"psr/log":"^3.0", // Logger interface
"symfony/filesystem":"6.0", // Filesystem operations
"symfony/finder":"6.0", // File discovery
"league/mime-type-detection":"1.11", // MIME detection for uploads
"respect/validation":"2.2", // Declarative validation rules
"symfony/translation":"6.0", // i18n / translation catalogs
"egulias/email-validator":"4.0", // RFC-compliant email validation
"paragonie/constant_time_encoding":"^2.7", // Timing-safe encoding
"paragonie/halite":"^5.1", // Libsodium-based encryption
"defuse/php-encryption":"2.4", // Authenticated symmetric encryption
"web-token/jwt-library":"3.3", // JWS / JWE / JWK toolchain
"firebase/php-jwt":"6.0", // Lightweight JWT encode/decode
"psr/cache":"3.0", // Cache pool interface
"nesbot/carbon":"^3.9", // Date & time handling
"illuminate/database":"^12.18", // Eloquent ORM & schema builder
"paragonie/hidden-string":"^2.2", // Prevent secrets leaking in dumps/logs
"symfony/security-csrf":"^7.3", // CSRF token management
"illuminate/pagination":"^12.18", // Query result pagination
"illuminate/events":"^12.18", // Event dispatcher

// highlights

What's New in v2

Same lightweight philosophy, now standing on well-maintained shoulders.

🧬

Eloquent ORM

Full model relationships, migrations and query builder from Illuminate Database.

🪪

JWT Authentication

Issue and verify signed tokens for stateless auth and third-party APIs.

🔐

Libsodium Encryption

Authenticated encryption via Halite, with legacy support through defuse/php-encryption.

Rule-based Validation

Fluent, composable validation chains instead of manual if/else checks.

📡

Resilient HTTP Client

Guzzle-backed outbound requests with middleware, retries and timeouts.

📝

PSR-3 Logging

Monolog handlers routed to files, and any future log aggregator.

🌍

Multi-language Support

Translation catalogs powered by Symfony Translation.

🛡

Framework-grade CSRF

Token generation and validation delegated to Symfony Security CSRF.

📆

Carbon Dates

Human-friendly date manipulation across the Scheduler and Models.

🧩

Event Dispatcher

Decoupled listeners via Illuminate Events for cross-module hooks.

📂

Robust Filesystem

File discovery and manipulation via Symfony Filesystem & Finder.

🐞

Dev-time Debugging

symfony/var-dumper for readable variable dumps during development.


// file structure

Project Layout

The same predictable convention, now with a vendor/ directory and a composer.json at the root.

NM Base Framework v2 /
App/
│  ├──Controllers/ → Application controllers
│  ├──Models/ → Illuminate Eloquent models
│  └──database/migrations · seeders → Schema & seed data
config/
│  ├──.env → Loaded via vlucas/phpdotenv
│  └──app.php · database.php · mailer.php → Domain config files
Core/
│  ├──Authentication/ → Auth, email verify, password reset
│  ├──Database/ → ORM, Migrator, BaseModel (Eloquent)
│  ├──Events/ → EventDispatcher (illuminate/events)
│  ├──Foundation/ → App, Bootstrap, Container (psr/container)
│  ├──Http/ → Request, Response (symfony/http-foundation)
│  ├──Middleware/ → Ajax, EmailVerified, Throttle
│  ├──Routing/ → Router, Route, RouteCompiler
│  ├──Security/ → CSRF, Crypto, Encryption, JWT, keys/
│  ├──Services/ → Captcha, Sitemap, Libraries/
│  ├──System/ → Config, Environment, Log, SessionManager
│  └──ViewEngine/ → Section-based template engine
public/
│  ├──index.php → Application entry point
│  └──assets/ → images · scripts · styles
resources/
│  ├──assets/layouts · partials · views → Templates & layouts
│  └──files/ → robots.txt, sitemap.xml
routes/
│  └──web.php → Route definitions
storage/
│  ├──framework/ · cache/ → Runtime & cache pools (psr/cache)
│  ├──logs/ → Monolog output
│  └──uploads/ → User-generated files
vendor/
   └── → Composer-managed dependencies
composer.json

Ready to upgrade?

Run composer install and you're set.

View on GitHub