Leaf MVC v3 (🎻 Stroh) has just been released. "🎻 Stroh" builds on the changes from Leaf PHP and takes API development to a whole new level of ease. Read the docs
Leaf API is a lightweight PHP MVC framework for rapid API development. LeafAPI serves as minimal MVC wrapper around Leaf PHP Framework which allows you to use Leaf in an MVC environment. With a simple structure and a shallow learning curve, it's an excellent way to rapidly build powerful and high performant APIs.
You can quickly create a Leaf API project with composer.
composer create-project leafs/api <project-name>
That's it! This will create a new Leaf API project named <project-name>
.
You can download the source files from github and extract it to get the LeafAPI files. All that's left is to install the dependencies.
composer install
After this has completed it's installation, you just need to generate your application env file. You can copy and rename your .env.example
file to .env
, but aloe cli provides a way easier approach.
php leaf env:generate
That's all!
In your project directory, you should have a structure like this.
C:.
├───App
│ ├───Console
│ ├───Controllers
│ ├───Database
│ │ ├───Factories
│ │ ├───Migrations
│ │ └───Seeds
│ ├───Helpers
│ ├───Models
│ └───Views
├───Config
│ └───Command
├───Lib
├───public
├───storage
│ ├───app
│ │ └───public
│ ├───framework
│ │ └───views
│ └───logs
└───vendor
In the project root, you can open up your console tool and type in
php leaf serve
This will start the php web server and load your project at http://localhost:5500
by default.
Built with ❤ by Mychi Darko