The Zero-Legacy PHP Framework Built for 2026 & Beyond
Built from the ground up — zero Symfony packages, zero third-party runtime libraries, zero mutable static state, and zero magic global facades.
Persistent-runtime first, with Live 2.5 & Bridge, built-in /_ops, Hybrid RRF Search, Oshie / Chie / Hantei AI companions, and a native 15-tool MCP Server.
Expressive PHP 8.5, Zero Magic Underneath
Declarative attributes, strict readonly DTOs, Live 2.5 hypermedia & React/Vue/Svelte Bridge, zero-N+1 data ergonomics, Hybrid RRF search, and global-free testing out of the box.
<?php
declare(strict_types=1);
namespace App\Http;
use Kongono\Http\Response;
use Kongono\Http\Routing\{CacheControl, Feature, Get, Idempotent, Middleware, Post, Prefix};
use Kongono\Security\Attributes\{Authenticated, Can};
use Kongono\Security\Middleware\BearerAuthMiddleware;
use Kongono\Security\Principal;
#[Prefix('/api/notes')]
final readonly class NoteController
{
#[Get('/', name: 'notes.index')]
#[CacheControl(maxAge: 60, public: true, staleWhileRevalidate: 30)]
public function index(): Response { /* auto ETag & 304 Not Modified */ }
#[Post('/', name: 'notes.create')]
#[Middleware(BearerAuthMiddleware::class)] // Supports revocable SHA-256 PersonalAccessToken
#[Authenticated]
#[Can('notes.write')]
#[Idempotent(ttlSeconds: 3600)]
public function create(CreateNoteInput $input, Principal $actor): Response
{
return Response::json(['author' => $actor->id, 'title' => $input->title], 201);
}
#[Get('/insights', name: 'notes.insights')]
#[Feature('beta_insights')]
public function insights(): Response { /* fail-closed 404 unless enabled */ }
}
<!-- Kongono Live 2.5: zero-build, strict-CSP reactive hypermedia (keyed morph + zero-eval AST) -->
<form kgn-post="/tasks" kgn-target="#task-list" kgn-swap="morph" k-persist="draft-task">
<input name="title" value="@old('title')" required>
@error('title') <span class="err">{{ $message }}</span> @enderror
<button type="submit">Add Task</button>
</form>
<!-- Hybrid React / Vue / Svelte island inside a .kgn.html template -->
@island('PriceChart', ['series' => $metrics])
// Or serve Live fragments, Bridge SPA pages, and JSON from one handler:
return Response::adaptive($request,
html: fn() => $views->render('tasks/index', ['tasks' => $tasks]),
fragment: fn() => Response::fragment($views->render('partials/task-list', ['tasks' => $tasks])),
bridge: fn() => Response::page('Tasks/Index', ['tasks' => $tasks]),
json: fn() => Response::json(['tasks' => $tasks]),
);
<?php
declare(strict_types=1);
use Kongono\Validation\Attributes\{ArrayOf, Between, Confirmed, Date, Email, Ip, Min, NotIn, Required, RequiredIf, Uuid};
use Kongono\Validation\{ValidatableDtoInterface, ValidationErrors};
enum Plan: string { case Free = 'free'; case Pro = 'pro'; }
final readonly class SignupInput implements ValidatableDtoInterface
{
/** @param list<string> $tags */
public function __construct(
#[Required, Uuid] public string $requestId,
#[Required, Email] public string $email,
public Plan $plan,
#[RequiredIf('plan', 'pro'), Min(2)] public ?string $companyName = null,
#[NotIn(['admin', 'root'])] public string $handle = 'member',
#[Date] public ?string $launchDate = null,
#[Ip] public ?string $allowlistIp = null,
#[ArrayOf('string', min: 1, max: 5)] public array $tags = ['php85'],
#[Required, Min(12)] public string $password = '',
#[Required, Confirmed('password')] public string $passwordConfirmation = '',
) {}
public function validateSelf(ValidationErrors $errors): void { /* cross-field rules */ }
}
use Kongono\Database\BatchLoader;
use Kongono\Database\Testing\Factory;
// Parameterized SQL with soft deletes, tenant isolation & pagination
$posts = $db->table('posts')
->forTenant($tenant)
->withoutTrashed()
->orderBy('created_at', 'DESC')
->paginate(page: 1, perPage: 25);
// Zero-N+1 eager relation loading without ActiveRecord magic
$commentsByPost = BatchLoader::hasMany($db, 'comments', 'post_id', $postIds);
$authorsById = BatchLoader::belongsTo($db, 'users', 'id', $authorIds);
// Soft delete & restore explicitly
$db->table('posts')->where('id', '=', $id)->softDelete();
$db->table('posts')->where('id', '=', $id)->restore();
// Typed immutable test/seed factories
$factory = Factory::for(UserDto::class, fn(int $n) => ['email' => "user{$n}@example.test", 'role' => 'member']);
$admins = $factory->state(['role' => 'admin'])->count(3)->make();
use Kongono\Ai\AiClient;
use Kongono\Ai\Embedding\{HybridSearch, KnowledgeBase, PgVectorStore};
use Kongono\Ai\Provider\OpenAiProvider;
use Kongono\Database\Search\PostgresFullTextSearch;
// Fuse PostgreSQL full-text search (tsvector/ts_rank_cd) + pgvector HNSW via Reciprocal Rank Fusion
$fts = new PostgresFullTextSearch($db, table: 'docs', textColumns: ['title', 'body']);
$vectors = new PgVectorStore($db);
$hybrid = new HybridSearch($fts, $vectors, rrfK: 60);
$hits = $hybrid->search(queryText: 'FrankenPHP worker resetScope', queryVector: $embedding, limit: 5);
// Or use 5-line RAG with secret scrubbing & inline [1] citations
$kb = new KnowledgeBase(new OpenAiProvider($_ENV['OPENAI_API_KEY']), $vectors);
$kb->ingest('handbook-v1', file_get_contents('docs/handbook.md'), ['team' => 'eng']);
$result = $kb->ask('How does Kongono prevent request state leakage?', AiClient::fromEnv());
use Kongono\Core\Clock\FrozenClock;
use Kongono\Database\Testing\DatabaseTestHelper;
use Kongono\Http\Testing\{TestClient, TestUpload};
use Kongono\Security\Egress\SafeHttpClient;
// Zero global state: explicit FrozenClock, SSRF-enforcing HTTP fake & SAVEPOINT rollback
$clock = FrozenClock::at('2026-11-22T12:00:00Z');
$fakeHttp = SafeHttpClient::fake(['https://api.partner.test/*' => ['status' => 200, 'body' => '{"ok":true}']]);
DatabaseTestHelper::inRollbackTransaction($db, function () use ($app, $admin): void {
$client = (new TestClient($app))->actingAs($admin)->withStatefulCookies()->followRedirects();
$client->postMultipart('/avatars', files: ['avatar' => TestUpload::fakePng('me.png')])
->assertCreated()
->assertJsonPath('status', 'stored');
});
Everything You Need — Zero Legacy Baggage
Three tool-equipped AI companions, a 15-tool MCP server, reactive Live 2.5 & Bridge frontends, capability-gated /_ops, production queues, and adversarial security out of the box.
Interactive AI Tutor & Grader
12 lessons + 6 verifiable hands-on exercises (kongo oshie --exercise), live CLI & SSE streaming, AGENTS.md grounding, --progress tracking, and live DevInspector trace awareness.
Self-Verifying AI Builder
Inspects code & live DB schema via AgentPrincipal, applies surgical patches (action: "patch"), supports --interactive diff approval and --continue, and auto-repairs across PHPStan + PHPUnit + lint + security gates (--apply --verify).
AI Debugger, Watcher & PR Reviewer
Tool-equipped root-cause diagnosis (CLI, /_kongono traces, /_ops DLQ jobs, hantei watch), closed-loop hantei fix, CI SARIF 2.1.0 hantei review, and PHPUnit 13 test generation — all secret-scrubbed.
Model Context Protocol Server
Run kongo mcp (stdio) or POST /mcp so Antigravity, Cursor, Claude Code, and Codex inspect routes, OpenAPI 3.1, live DB schemas, audits, AI evals, migration lints, Hantei diagnoses, and read-only Chie diff previews safely.
Zero-Build Hypermedia or React/Vue/Svelte
Ship strict-CSP keyed DOM morphing, zero-eval() signals, kgn-oob, k-persist offline queues, and kgn-sortable — or drop into React/Vue/Svelte via Response::page() and @island.
Built-In Operations & Dev Studio
Capability-gated Live 2.5 /_ops (queue depths, 1-click DLQ retry/flush, JobBatch progress, health & Prometheus metrics) plus /_kongono Time-Travel Replay and TestExporter.
Complete Auth & AI Threat Shield
SessionAuth, revocable SHA-256 Personal Access Tokens, Passkeys, Magic Links, PKCE OAuth, TOTP MFA, theft-detecting Remember-Me, HKDF Encryptor v2, HtmlSanitizer, AiThreatShield, and PromptGuard.
Durable Background Execution
PostgreSQL SKIP LOCKED + Lua-atomic Redis queues with priority draining, dead-letter CLI replay, uniqueKey dedup, job middleware, parallel JobBatch, and multi-day durable Workflows.
FrankenPHP, Hybrid RAG & SDKs
Zero static leaks, Fiber Async, O(1) + chunked PCRE2 AOT Router, streaming S3/Local storage, PostgreSQL FTS + pgvector Hybrid RRF, and typed TypeScript/Swift/Kotlin/Dart SDK generation.
Coming from Laravel or Symfony?
Kongono gives you batteries-included productivity while keeping zero legacy debt and strict persistent-runtime safety.
| Capability | Traditional PHP Frameworks | Kongono v1.19 (PHP 8.5+) |
|---|---|---|
| Runtime Dependencies | 50–90+ transitive packages (Symfony core + polyfills) | 8 packages total (Kongono + 7 PSR interfaces, 0 Symfony) |
| Persistent Runtimes | Bolt-on resetters (Octane) to patch static/global state | 0 mutable statics: explicit OperationScope + Container::resetScope() + zero-reflection dispatch cache |
| Frontend & Reactivity | Separate packages (Livewire / Inertia) + JS build toolchains | Built-in Live 2.5 (~3 KB, zero-eval() strict CSP) + Bridge (React/Vue/Svelte + @island) |
| Data & Search | ActiveRecord magic (__get/__set) + external search servers |
Explicit QueryBuilder (soft deletes, RLS), zero-N+1 BatchLoader, typed Factory, and PostgreSQL FTS + pgvector Hybrid RRF |
| Ops, Queues & Dev Studio | Horizon + Pulse + Telescope + Scramble (separate installs) | Built-in zero-npm /_ops (queue/DLQ/batch/metrics), /_kongono Dev Studio, and OpenAPI 3.1 /docs |
| Auth, Testing & AI Safety | Sanctum/Fortify + global fakes + ad-hoc AI glue | Native SessionAuth, revocable PATs, Passkeys, global-free TestClient/FrozenClock, kongo audit --attack, kongo eval --redteam/--companions, SARIF hantei review, and 15-tool MCP |