Skip to content
Leaf 5 — A new era

Build products at
the speed of thought

Leaf 5 is an AI-native PHP framework with project context built in, so assistants understand your app, Craftly can turn patterns into product, and your code stays clean, readable, and yours.

Terminal

Open Source

Backed by the community

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

Give your agent the context your PHP app deserves.

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.

01Context

Agents get the map

Leaf keeps routes, modules, structure, conventions, and project state readable so AI can work inside your app instead of guessing around it.

02Patterns

Agents follow your conventions

Routes, controllers, models, services, config, and views stay predictable, so generated code lands where it belongs.

03Sync

Context moves both ways

Agents read shared project memory alongside the code, then write useful changes back so the next session starts informed.

AI composer

Ask your agent

Build a customer portal with billing and a CMS view

Shared context connectedtwo-way sync
reads shared project memoryfinds routes and modulesuses app conventionswrites project knowledge back

Agent workflow

  1. reads .leaf/context.md before writing code
  2. finds the right routes, modules, and services
  3. generates code that matches local patterns
  4. syncs useful project changes back into context

Workflow

Real code. Less friction. Faster flow.

AI-first design meets battle-tested PHP code, giving you the power to ship real products faster and cheaper than ever before.

01

Start with structure

Spin up a full project with auth, db, and routing already in place, or generate your own custom setup with AI.

02

Write logic, not boilerplate

From AI or your keyboard, write the logic that matters without getting bogged down in repetitive boilerplate.

03

Ship without friction

Deploy anywhere PHP runs. No lock-in, no hidden layers, just your product running the way you built it.

~30sto scaffold a project
1shared agent context
0extra config for AI context
hours saved per project

Architecture

Your code stays structured. No matter how you build.

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

Consistent by default

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.

php
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

Your stack stays yours

Use any frontend you want. React, Vue, Svelte, Blade, PHP. Your AI assistant still gets the same backend map. Your tools follow your stack.

Learn more

Leaf route

app()->get('/menu/items', function() {
  $items = db()->select('menu_items')->all();

  return response()->inertia('menu', [
    'items' => $items
  ]);
});

React view

export default function Menu({ items }) {
  return (
    <div className="menu-grid">
      {items.map((item) => (
        <MenuCard key={item.id} item={item} />
      ))}
    </div>
  );
}
Rendered by React from Leaf data
🍔

Veggie Loaded Burger

Vegan • 4 stars

$8.99
🍗

Southern Fried Chicken

Spicy • 5 stars

$9.49
Reactor anything
Vueor anything
Svelteor anything
Bladeor anything

Ecosystem

One team. A whole toolchain.

Leaf is more than the framework — it's a family of focused tools that work anywhere PHP (or JavaScript) runs, each with its own home.

Agent-ready

Start from a prompt. Keep the code yours.

Leaf gives AI enough structure to help without taking over. Ask for a feature, review familiar PHP files, and keep shaping the app by hand or with your agent.

Prompt starters

With the agent inside your project, each prompt starts from shared context plus the live codebase. Useful structural changes sync back when the work is done.

Agent output

reviewable PHP
leaf agent plan
app/routes/billing.php
app/controllers/BillingController.php
app/models/Subscription.php
app/views/admin/billing.blade.php
human-readable diffsno hidden runtime

Community

Join other people building real products

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 us
Leaf Community

Building in public

Ideas behind the way we build

How we think about frameworks, AI-assisted development, and shipping products that last.

Speak at an event

Invite us to your next 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

We bring real code, real speed, and agent-friendly Leaf 5 walkthroughs.

Free of charge

We speak for free. Just cover travel if it's in-person.

Contributors

Wall of Fame

These contributors make Leaf cleaner, faster, and easier for humans and AI tools to understand.

Deploys by Netlify

Get notes on Leaf 5, AI-native PHP, and product-building in your inbox. You can also read our blog posts at blog.leafphp.dev. You may also go social at Twitter, join our discussions, or watch our videos on YouTube.