Leaf is a PHP framework that helps you create clean, simple but powerful web apps and APIs quickly and easily. Leaf introduces a cleaner and much simpler structure to the PHP language while maintaining it"s flexibility. With a simple structure and a shallow learning curve, it"s an excellent way to rapidly build powerful and high performant web apps and APIs.
Leaf 3 brings a much cleaner, faster and simpler workflow to your apps. Powered by an ecosystem of powerful modules with zero setup and it"s ease of use, Leaf now allows you to tackle complexities no matter the scale.
Install Leaf 3:
You can create a Leaf 3 app with the Leaf CLI
leaf create <project-name> --v3 --basic
<project-name>
is your project name
You can also use Composer to install Leaf 3 in your project quickly.
composer require leafs/leaf v3.0-beta
Install Leaf 2:
Since leaf 3 is still in beta, you might want to install the stable leaf 2 instead. You can do this with Leaf CLI or composer.
leaf create <project-name> --basic
Or with composer
composer require leafs/leaf
This is a simple demonstration of Leaf"s simplicity. After installing Leaf, create an index.php file.
<?php
require __DIR__ . "/vendor/autoload.php";
// Base example
app()->get("/", function () {
response()->json([
"message" => "Welcome!"
]);
});
app()->run();
If you use the Leaf CLI, this is already done for you π.
You may quickly test this using the built-in PHP server:
php -S localhost:8000
You can view the full documentation here
- Leaf has a very easy to understand documentation which contains information on all operations in Leaf.
- You can also check out our youtube channel which has video tutorials on different topics
- We are also working on codelabs which will bring hands-on tutorials you can follow and contribute to.
We are glad to have you. All contributions are welcome! To get started, familiarize yourself with our contribution guide and you"ll be ready to make your first pull request π.
To report a security vulnerability, you can reach out to @mychidarko or @leafphp on twitter. We will coordinate the fix and eventually commit the solution in this project.
Michael Darko |
AdemΓlson F. Tonato |
Tobias Herber |
Pjotr Savitski |
Pablo Ferreiro |
jess |
Sergey Romanenko |
Your cash contributions go a long way to help us make Leaf even better for you. You can sponsor Leaf and any of our packages on open collective or check the contribution page for a list of ways to contribute.
And to all our existing cash/code contributors, we love you all β€οΈ
Aaron Smith |
Peter Bogner |
Vano |