Modules โ
Modules are pieces of Leaf functionality that can be added to your application to extend its capabilities. Unlike many other frameworks, Leaf ships very light out of the box and provides all extra functionality through modules. This allows you to keep your core application lean while only adding the features you need.
Installing Modules โ
Modules are Composer packages, so you can install them with Composer:
composer require leafs/<module>If you're using Leaf CLI, you can install official Leaf modules without the leafs/ prefix:
leaf install <module>You can also install multiple modules at once:
leaf install auth db mailUsing Modules โ
Most modules integrate directly into Leaf's functional style, so you can use focused helpers without building your own wiring layer.
auth()->login($credentials);
db()->select('users')->where('id', 1)->first();
response()->json(['ok' => true]);In Leaf MVC, modules can also work through config files, controllers, models, services, and other structured app pieces.
Common Module Groups โ
Modules and AI Context NewInstalled modules stay visible to agentsLeaf keeps module capabilities in shared project context and can produce a compact handoff for external assistants. โ
Modules make your app easier for assistants to understand because installed packages and their configuration are recorded in .leaf/CONTEXT.md. Agents inside the project read that shared memory alongside the filesystem and keep it aligned as the app changes.
If you are sharing the app with an external assistant that cannot access the folder, generate a compact handoff after adding modules:
leaf contextThe command prints a minified view of the shared context, including installed modules, app structure, routes, and conventions. Paste that output into the external assistant so it can use what your app already has instead of inventing new patterns.
List of Modules โ
We update this list regularly. If you have a module you'd like to see here, feel free to open an issue or create a pull request on our documentation repository. Community-created modules are welcome too.
| Project | Status | Description |
|---|---|---|
| alchemy | Tests, code style, refactoring, static analysis + CI for any PHP app, from one config | |
| anchor | Built-in protection for your Leaf apps | |
| auth | Simple but powerful authentication system for your apps | |
| bareui | Dead simple templating engine with no compilation | |
| billing | Subscriptions and one-time payments, one API across providers | |
| blade | Laravel blade port for leaf | |
| cache | Cache results of expensive operations | |
| cookie | Cookie management for your PHP apps | |
| cors | CORS operations made simple | |
| csrf | CSRF protection for your Leaf apps | |
| date | Dead simple PHP dates | |
| db | Lightweight query builder for your PHP apps | |
| exception | Crash reports with stack traces, user journeys and AI handoff | |
| fetch | HTTP requests made simple | |
| form | Form processes and validation | |
| fs | Awesome filesystem operations + file uploads | |
| http | Http operations made simple (request, response, ...) | |
| inertia | Leaf adapter for inertia JS | |
| lingo | Multi-language (i18n) support for your apps | |
| logger | leaf logger module | |
| Mailing made easy with leaf | ||
| mvc-core | Brain of Leaf MVC | |
| password | Password encryption/validation/hashing in one box | |
| paystack | Billing with paystack | |
| queue | Queue integration for leaf | |
| redis | Functionality for Redis | |
| s3 | Drop-in aws s3 module for Leaf FS | |
| schema | Git for your database: migrations, seeds and schema files | |
| seedling | Lightweight console application framework | |
| session | PHP sessions made simple | |
| sitemap | PHP sitemaps made simple | |
| sprout | Fast, lightweight and minimal CLI framework for PHP | |
| stripe | Billing with Stripe | |
| vite | Leaf server component for Vite |
Community Modules โ
Modules created by the Leaf community are welcome here. They're not officially maintained by the Leaf team, but we're happy to list them. Built something? Open an issue or send a pull request on the documentation repository to add yours.
