Skip to content

Introduction

Modules are a new feature added in Leaf 3 which basically takes parts of Leaf and separates them into installable chunks which can be used both inside and outside of Leaf.

Modules are framework/library agnostic, which means that they'll work just about everywhere with zero config just as with Leaf itself.

Modules can be quickly installed through composer or the leaf CLI with a single command.

Why modules?

The biggest question people ask with Leaf 3 is why we decided to switch to modules, stripping leaf of almost all it's code.

@mychidarko put an article together on why we decided to switch to modules instead of maintaining the whole code together. We also have a GitHub discussion introducing leaf 3 and everything you need to know about it, we explain modules further here.

Installing modules

Modules are always published on composer and can be installed through composer CLI or the leaf CLI.

Composer:

composer require leafs/<module-name>

Leaf CLI:

leaf install <module-name>

List of available modules

This list is still being updated, 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)
exception Leaf's exception wrapper (fork of whoops)
experiments collection of experimental modules
fetch HTTP requests made simple
form Form processes and validation
fs Awesome filesystem operations + file uploads
http Http operations made simple (request, response, ...)
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
Introduction has loaded