HexPHP Framework
Build Faster. Stay Native.
Welcome to the new component-based architecture!
The 6 Pillars of HexPHP
A practical stack philosophy that avoids magic while giving you modern ergonomics.
Native PHP
Scoped template engine using standard `.php` files. Output buffering keeps logic cleanly separated—no Blade or Twig required.
HTMX Gateway
Handles AJAX requests for SPA-like updates out of the box. Swap HTML fragments instantly without heavy JavaScript framework routing.
Eloquent ORM
Empowered by Laravel's Illuminate Database. Provides a powerful, fluent query builder, data mapping, and bulletproof relational models.
Component Mailer
A unified SMTP template engine. Build sleek, responsive emails exactly like you build your web components, completely eliminating messy string constraints.
Bootstrap Driven
Powered natively by Bootstrap 5. Provides a robust, widely-understood CSS engine to quickly snap together ultra-modern, responsive UIs.
Hex Router
A unified entry point built for speed. Lightweight, regex-based PHP script routing clean URLs instantly to controller functions.
Everything Else You Need
Beyond the 6 pillars, HexPHP ships with a full suite of production-ready utilities.
Auth & RBAC
Full session-based authentication with role-based access control. Protect routes with middleware in a single line—no third-party packages required.
Read the docs →Request Validation
Fluent, declarative validation rules for any incoming request. Easily define required fields, type checks, length limits, and custom messages.
Read the docs →Security & Env
Built-in CSRF protection, XSS sanitisation helpers, and a
lightweight .env loader. Secure by default without complex configuration.
Error Handling
Centralised exception handler with environment-aware output. Pretty dev errors, clean production pages—all routed through a single, overridable handler.
Read the docs →CLI Tooling
The hex command-line tool scaffolds controllers,
components, models, and runs migrations—keeping your workflow fast without leaving the terminal.
HTMX Live Demo
See HexPHP's HTMX integration in action. Dynamic fragment swaps, out-of-band updates, and form handling—all without writing a single line of JavaScript.
Try the demo →