01 · Context
Agents get the map
Routes, modules and conventions are written down where a model looks first.
Leaf is the lightweight PHP framework for shipping real products. Pull in auth, billing, queues and 25+ other modules only when your app needs them. Your AI tools get real project context to work with, and the code stays clean, readable, and more importantly yours.
Open Source
Leaf is fully community-backed. Your support keeps the momentum going as we make modern PHP faster, cleaner, and more AI-ready.
AI-native framework
Leaf makes your routes, modules, structure, conventions, and project state readable to AI, so assistants can build inside your app instead of guessing around it.
public function store() { $data = request()->validate([ 'items' => 'array|required', 'coupon' => 'optional|string', ]); $order = Order::create($data); billing()->charge($order); return response()->json($order); }
# my-product stack leaf 5 · mvc · sqlite · react/inertia modules auth, db, billing, queue ## conventions routes → app/routes/*.php controllers → app/controllers, one per resource validation → request()->validate() first ## recent + OrdersController::store charges on create
01 · Context
Routes, modules and conventions are written down where a model looks first.
02 · Patterns
Every module shares the same fluent shape, so generated code lands where you'd put it.
03 · Sync
Useful changes get written back, so the next session starts informed.
Where Leaf sits
You start with routing and a request object. Everything else is a module you install when the product needs it, not a layer you inherit on day one. That's what keeps the app small enough to hold in your head, and in a context window.
Routing and a request object. Auth, db and billing become a package hunt and a weekend.
Start with app(). Add auth(), db(), billing() as the product grows. Same fluent shape on every module, so there's one pattern to learn.
Everything included, whether you use it or not. Powerful, and a lot to hold in mind before feature one.
Architecture
Leaf keeps your app consistent, readable, and easy for AI to reason about from day one, so every feature, change, and iteration fits naturally into your codebase.
Pattern language
Every module in Leaf follows the same API patterns. Routes, controllers, models, and services all use familiar patterns, so you don't have to learn a different way for each part.
auth()->login([...]);
db()->select(...)->where([...]);
cache()->get('key');
response()->json([...]);Same fluent, chainable pattern across everything. This predictability is what makes tools and AI work better with your code.
Frontend
Use any frontend you want. Your AI assistant still gets the same backend map. Your tools follow your stack. Learn more ↗
app()->get('/menu/items', function() { $items = db()->select('menu_items') ->all(); return response()->inertia('menu', [ 'items' => $items ]); });
const Menu = ({ items }) => ( <div className="menu-grid"> {items.map((item) => ( <MenuCard key={item.id} item={item} /> ))} </div> ); export default Menu;
Veggie Loaded Burger
Vegan · 4 stars
Southern Fried Chicken
Spicy · 5 stars
Healthy Beef Burger
Low-carb · 4 stars
Ecosystem
Leaf is more than the framework. We're a family of focused tools that work anywhere PHP (or JavaScript) runs, each with its own home.

Alchemy
QA from one config
Tests, code style, refactors, static analysis + CI pipelines for any PHP app, described in one alchemy.yml.

Seedling
Console applications
A tiny framework for building CLI tools with the Leaf MVC experience: commands, prompts, and packaging.

Fetch
HTTP client
fetch() for PHP. The request API you already know from JavaScript, in any PHP app, Leaf or not.

Auth
Authentication
Login, registration, roles, permissions and subscriptions for any PHP app. Sessions or JWT, one API.

Db
Database
Fluent queries and raw SQL without a heavy database layer. MariaDB, MySQL, Postgres, SQLite, SQL Server.

Kata
Design systems for AI
Compile your design system into a language AI can build with, so generated UIs come out looking like yours.
Hana JS
Frontend framework
Simple, lightweight React alternative for building user interfaces, from the same team.
25+ modules, one install away
Auth, databases, queues, mail, billing and more: grab exactly what you need, nothing else.
Community
Build alongside developers shaping how modern products are made. Share what you're building, get help when you're stuck, and compare the ways people are building with AI in real Leaf apps.
The Leaf Discord is where releases drop first, questions get answered, and builders show off what they're shipping, from weekend projects to production apps.
Start building with usBuilding in public
How we think about frameworks, AI-assisted development, and shipping products that last.
Ten releases in two days, a Windows bug we could not reproduce, and the boring config file that held it all together.
The biggest release in our history: a new routing engine, Leaf Crash, AI-native projects, and a family of stable modules.
Speak at an event
Want a Leaf core team member to speak? We'd love to bring practical Leaf 5 and AI-native PHP demos to your attendees.
Any format
Conferences, meetups, workshops, Twitter Spaces. We're flexible.
AI-native demos
Live coding on real Leaf 5 apps, including the agent workflow people keep asking about.
Free of charge
We speak for free. Just cover travel if it's in-person.
Contributors
These contributors make Leaf cleaner, faster, and easier for humans and AI tools to understand.