v1.0.0  —  PHP 8.5 MVC Framework

Build fast.
Ship with confidence.

PulseMVC is a modern, lightweight PHP framework with attribute-based routing, a fluent query builder, real-time SSE support, and an expressive CLI — no magic, no bloat.

Routes
Auto-discovered
8
Middleware
Built-in
22+
CLI Commands
All in one
2
Dependencies
Twig + Dotenv

What's included

Attribute Routing

Declare routes on controller methods with #[Route]. Auto-discovered, cached, no route files needed.

Fluent Query Builder

PDO-backed Active Record with migrations, schema builder, paginator and soft deletes.

Real-time SSE

Server-Sent Events with exponential backoff reconnect and a clean JS client out of the box.

Middleware Pipeline

PSR-15 inspired onion middleware. CSRF, auth, throttle, CORS, and maintenance mode built in.

Validation Engine

35+ built-in rules, bail, sometimes, conditional rules, and AJAX-aware error responses.

Artisan-style CLI

make:*, migrate, db:seed, db:backup, cache:clear, serve — all from `php mvc`.

Twig Templates

Twig 3.x integration with CSRF fields, flash messages, old input, and custom extensions.

File-based Cache

put/get/forget/remember/rememberForever with cache tags, TTL, and rotation via cache:clear.

CSRF Protection

Timing-safe token verification via hash_equals(). Automatically applied to all mutating routes.

Quick Start

PHP 8.5
// Declare a route group on the controller class
#[RouteGroup(prefix: '/users', namePrefix: 'users.')]
class UserController extends BaseController
{
    #[Route('/', method: 'GET', name: 'index', middleware: ['auth'])]
    public function index(Request $request): Response
    {
        $users = User::orderBy('name')->paginate(15);

        return $this->view('users/index', compact('users'));
    }

    #[Route('/{id:\d+}', method: 'GET', name: 'show')]
    public function show(Request $request, int $id): Response
    {
        $user = User::findOrFail($id);
        return $this->view('users/show', compact('user'));
    }
}