Skip to content

Introduction

Modules are the pieces of Leaf's functionality that are individually available as packages. They can be used in a wide variety of projects, and are one of the primary ways that Leaf is extended with additional functionality.

Most modules are framework/library agnostic, which means that they'll work just about everywhere with zero config just as with Leaf itself. You can easily install them with composer or the leaf cli.

Why modules?

We have a ton of reasons for switching to modules that we covered in this blog post. However, here are a few of the main reasons:

  • Modules are easier to update and maintain
  • Modules allow you to use only the parts of Leaf you need
  • Modules allow you to incrementally upgrade your Leaf apps
  • Modules allow you to use Leaf with other frameworks

Installing modules

You can quickly install any module with the Leaf CLI:

leaf install <module-name>

Or with composer:

composer require leafs/<module-name>

List of available modules

We update this list whenever we add new modules, you can keep checking for updates.

ProjectStatusDescription
alchemy Simpler tests for your PHP apps
aloe Smart console helper for leaf mvc, leaf api and skeleton
anchor Basic security tools
auth Simple but powerful authentication system for your apps
bareui Dead simple templating engine with no compilation (blazing speed)
blade Laravel blade templating port for leaf
cookie Cookie management without the tears
cors CORS operations made simple
csrf Basic CSRF protection
date PHP dates for humans
db Leaf Db from v2 (actively maintained)
db-old Leaf Db from v1 (still maintained)
devtools Developer tools for Leaf PHP
eien High-speed, high-performance server for leaf
exception Leaf's exception wrapper (fork of whoops)
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
logger leaf logger module
mail Mailing made easy with leaf
mvc-core Core MVC tools powering our MVC wrappers
password Password encryption/validation/hashing in one box
redis Redis module
router Default router for leaf php
session PHP sessions made simple
tilly (WIP) Simple utility 'toolkit' for PHP applications
veins Leaf veins templating engine
viewi Leaf integration with Viewi PHP
vite Leaf server component for Vite
Introduction has loaded