leafAPI
leafAPI copied to clipboard
Leaf API is a lightweight PHP MVC framework for rapid API development.
Leaf API 3
Leaf API is a lightweight but feature-rich MVC framework built on top of leaf php. It provides everything you need to build APIs with Leaf, faster and simpler than ever before.
📦 Installation
You can install Leaf API v3 with the Leaf CLI
leaf create <project-name> --api
Or for a more personalized installation, you can add --custom
to the command
leaf create <project-name> --api --custom
You can also use Composer if you don't want to use the Leaf CLI, although we recommend using the CLI for a better experience:
composer create-project leafs/api <project-name>
Note that <project-name>
is the name of the project you want to create, and that will be your folder name. You can also use .
to install in the current directory.
🗂 Directory Structure
```bash
C:.
├───app
│ ├───console
│ ├───controllers
│ ├───database
│ │ ├───factories
│ │ ├───migrations
│ │ ├───schema
│ │ └───seeds
│ ├───helpers
│ ├───models
│ ├───routes
│ └───views
├───config
├───lib
├───public
│ └───assets
├───storage
│ ├───app
│ │ └───public
│ ├───framework
│ │ └───views
│ └───logs
└───vendor
This directory structure is a blend of Ruby on Rails and Laravel
To run your Leaf API application, use
php leaf serve
📓 Learning Leaf API
-
Leaf API has a very easy to understand documentation which contains information on all operations in Leaf API.
-
Since Leaf API runs on Leaf, you should check out the Leaf PHP Framework documentation here.
-
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.
😇 Contributing
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.
🤩 Sponsoring Leaf
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.
We will furthermore like to thank our existing supporters, we love you all ❤️