<?php
require_once __DIR__ . '/vendor/autoload.php';
$app = new Leaf\App;
$app->set404();
$app->db()->autoConnect();
$app->get('/resources', function($id) use($app) {
$app->response()->json([
"resource" => $app->db()->select("resources")->all()
]);
});
$app->run();
Leaf v3.0 beta (👸🏼 Queen of the night) has just been released. Read the docs
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.
You can quickly get leaf installed in your application using composer. Simply run:
composer require leafs/leaf
You can then import leaf into your project and start building all your amazing projects. You can view your project using:
php -S localhost:8080
You may also create a Leaf project using Leaf CLI
leaf create <project-name>
From here, you'll have Leaf installed in your project. You can jummp to one of these pages.
Built with ❤ by Mychi Darko