Skip to content
Leaf 5 is out

The fastest way to build, for people and their agents

Leaf is small enough to learn in an afternoon and complete enough to run a business on. Leaf 5 adds the context an agent needs, so the code it writes is code you would have written yourself.

780,000+ ecosystem installs · 1,332 GitHub stars · MIT, since 2019

<?php
require __DIR__ . '/vendor/autoload.php';

app()->get('/plans', function () {
  $plans = db()
    ->select('plans', 'name, price')
    ->orderBy('price', 'asc')
    ->all();

  response()->json($plans);
});

app()->get('/plans/{id}', 'PlansController@show');

app()->run();

Clean code with no ceremony. Routing, DB, auth and validation ship as modules you add when you need them.

For people

Everything a product needs, nothing it does not

Declare a route in one line. Dynamic segments, groups, middleware and named routes are built in.

Read the docs
app()->get('/users/{id}', function ($id) {
  response()->json(['id' => $id]);
});

For agents

Built so agents stop guessing

The Leaf skill

Teaches an agent how to work in a Leaf project: which entry point to scaffold, how to read project context, what the scaffolds give you.

curl -o .claude/skills/leaf/SKILL.md https://leafphp.dev/ai/SKILL.md

Readable project state

One command prints the routes, modules and conventions an agent needs, so it uses what already exists.

leaf context

Alchemy for the QA floor

One alchemy.yml. Tests and static analysis run on every commit, so agent output is checked.

leaf run alchemy
How we think about agents

From the Lab

Products from Leaf AI Labs

Open Source

Backed by the community

Leaf is fully community-backed. Your support keeps the momentum going as we make building faster, cleaner, and more AI-ready.