Leaf 5: Build products at the speed of thought | Leaf Blog
Leaf 5 is the biggest release in Leaf's history , and it's not just a version bump. It's a natural evolution of what a PHP framework should be in a world where you build alongside AI: a product-first framework with project context built in, a family of tools that work in any PHP app, and a promise that your code stays clean, readable, and yours.<br>Why Leaf 5 exists #<br>Every framework says it makes you faster. But "faster" has changed. Today, you're not just writing code, you're directing it. You describe a feature, your AI assistant drafts it, you review and refine. The bottleneck isn't typing anymore; it's how well your tools understand your app.<br>Most frameworks were never designed for that. Conventions live in people's heads, structure hides behind abstractions, and an assistant dropped into the codebase has to guess its way around.<br>Leaf 5 is our answer: a framework where the structure is obvious, the patterns are consistent, and the project itself carries shared context that both humans and agents can read...and write back to. You ask for a billing module, and the generated code lands where it belongs, looking like the rest of your app. No black boxes. No cleanup afterwards.<br>And because we're product-first, Leaf 5 ships the pieces real products need: auth, databases, queues, mail, billing and 25+ other features as production-ready modules you pull in exactly when your app asks for them. Nothing more.<br>Still just PHP #<br>This part hasn't changed, and it never will. There's no hidden runtime, no proprietary lock-in, no deployment magic. A Leaf 5 app is a PHP app. It runs anywhere PHP runs, and everything it generates is code you can read line by line.<br>app()->get('/', function () {<br>response()->json([<br>'message' => 'Leaf 5 😉'<br>]);<br>});
app()->run();
If you've written Leaf before, you already know Leaf 5. If you haven't, you'll know it in an afternoon.<br>One team, a whole toolchain #<br>The other big shift in Leaf 5 is that we stopped thinking of Leaf as one framework and started building it as a family of focused tools , each with its own home and each usable far beyond Leaf itself:<br>Alchemy : your entire QA setup in one file. Tests (Pest or PHPUnit), code style, automated refactors, static analysis, and CI pipelines for GitHub, GitLab or CircleCI, all described in a single alchemy.yml. It works with Leaf, Laravel, Symfony, Slim, or plain PHP, installs nothing until you use it, and alchemy eject lets you leave anytime with real config files.
Seedling : build CLI tools with the Leaf MVC experience. Under the hood is Sprout, our zero-fuss console framework, which just went through a full stability pass: a real test suite, piped input and Windows fixes, and CI running across macOS, Ubuntu and Windows.
Fetch : fetch() for PHP. The request API you already know from JavaScript, working in any PHP app. We rebuilt the internals for v5: every documented option now actually works, form encoding is smarter, responses are more predictable, and the whole surface is covered by tests that run against a real server on every commit.
Hana JS : our simple, lightweight React alternative, because the frontend deserves the same "no overengineering" treatment.
That's on top of 25+ modules. Grab exactly what you need and nothing else.<br>Why framework-agnostic? Partly because good tools deserve a bigger audience. But honestly, it's also an AI-era bet: when an assistant is choosing a library for a task, small, sharp, well-documented tools win. We want Leaf's tools to be the obvious pick whether or not the app is a Leaf app.<br>Where Leaf 5 fits #<br>Leaf isn't only competing with other frameworks. It's competing with the moment where an early product starts working, users show up, and the codebase needs to become more serious without slowing you down.<br>The classic options both tax you at that moment. The tiny-router path gives you a fast start, then charges you product time to choose and wire auth, database patterns, validation, mail, queues, views, and structure yourself. The heavy-framework path is serious from day one, but your first version inherits more concepts and more ceremony than the product needs yet. Leaf's path is to start small, add first-party product modules when your app asks for them, move into MVC when structure earns its place, and keep the whole thing readable to humans and agents as it grows.<br>So, honestly:<br>Choose Laravel when you want the largest PHP product ecosystem and you're happy to adopt its full application model.<br>Choose Symfony when you need deep architecture control, mature components, and enterprise-grade composition.<br>Choose Slim when you want the smallest possible HTTP layer and you're comfortable assembling the rest of the product stack yourself.<br>Choose Leaf when you want to get a real PHP product into users' hands quickly, keep the app small enough to understand, and still have a path to auth, data, frontend, jobs, billing, deployment, and AI-assisted...