The lightweight PHP MVC core that powers Fluxor framework - File-based routing, elegant Flow syntax, and zero bloat.
Fluxor Core is the engine behind the Fluxor PHP framework - a minimal, elegant, and powerful MVC core designed for developers who want simplicity without sacrificing functionality.
Unlike monolithic frameworks, Fluxor Core gives you:
- 🚀 Blazing fast performance (boot under 10ms)
- 📦 Zero core dependencies - just pure PHP!
- 🔍 Transparent code - no magic, you can read everything
- 🎯 File-based routing inspired by Next.js
- 💎 Elegant Flow syntax for route definitions
- 🔒 Config locking to protect critical settings
- 🌐 Built-in CORS support (global + per-route)
composer require lizzyman04/fluxor<?php
require 'vendor/autoload.php';
$app = new Fluxor\App();
$app->run();All core classes are automatically re-exported for cleaner code:
use Fluxor\App;
use Fluxor\Request;
use Fluxor\Response;
use Fluxor\Flow;
use Fluxor\View;$app = new Fluxor\App();
$basePath = $app->getBasePath(); // Auto-detected!
$baseUrl = $app->getBaseUrl(); // Auto-detected!$app = new Fluxor\App();
$app->cors()->allowOrigin('*')->enable();
$app->run();// app/router/users/[id].php
use Fluxor\Flow;
use Fluxor\Response;
Flow::GET()->do(function($req) {
$userId = $req->param('id');
return Response::success(['user' => $userId]);
});$router = $app->getRouter();
$router->addMiddleware('auth', function($request) {
if (!$request->isAuthenticated()) {
return Fluxor\Response::redirect('/login');
}
});use Fluxor\Response;
$id = $request->param('id');
$email = $request->input('email');
$token = $request->bearerToken();
return Response::json(['user' => $user]);
return Response::view('profile', ['user' => $user]);use Fluxor\Flow;
// Simple route
Flow::GET()->do(fn($req) => 'Hello World');
// Controller binding
Flow::POST()->to(UserController::class, 'store');
// Middleware
Flow::use(fn($req) => $req->isAuthenticated() ? null : redirect('/login'));// In controller
return Response::view('home', ['title' => 'Home']);
// In view (home.php)
View::extend('layouts/main');
View::section('content');
<h1><?= View::e($title) ?></h1>
View::endSection();// Environment variables
$debug = env('APP_DEBUG', false);
$dbName = env('DB_NAME', 'database');
// Path helpers
$root = base_path();
$url = base_url('api/users');
$asset = asset('css/app.css');
// HTTP helpers
abort(404, 'Not Found');
return redirect('/dashboard');
// Debug helpers
dump($user);
dd($data); // Dump and dieFull documentation available at: 👉 https://lizzyman04.github.io/fluxor-php
The documentation includes:
- Installation guide
- File-based routing
- Flow syntax reference
- Views and layouts
- Controllers and middleware
- Environment configuration
- Complete API reference with helper functions
MIT License - see LICENSE file for details.
Fluxor - Build elegant PHP applications with joy! 🎉