leafs / mvc
A lightweight PHP MVC framework powered by Leaf
Installs: 3 730
Dependents: 0
Suggesters: 0
Security: 0
Stars: 45
Watchers: 6
Forks: 7
Open Issues: 2
Requires
- illuminate/console: ^8.75
- leafs/aloe: ^2.0
- leafs/auth: ^3.0
- leafs/blade: *
- leafs/cors: *
- leafs/csrf: *
- leafs/db: *
- leafs/form: ^3.0
- leafs/http: ^3.0
- leafs/leaf: ^3.7
- leafs/logger: *
- leafs/mvc-core: *
- leafs/vite: *
Requires (Dev)
- fakerphp/faker: ^1.16
- leafs/alchemy: ^2.0
README
Leaf MVC
Leaf MVC is a lightweight but feature-rich MVC framework built on top of leaf php. It gives you the simplicity of Leaf and it's modules with the structure of an MVC framework. Leaf MVC is a great choice for building applications that scale without the complexity of most modern frameworks.
📦 Installation
You can install Leaf MVC with the Leaf CLI
leaf create <project-name> --mvc
Or for a more personalized installation, you can add --custom
to the command
leaf create <project-name> --mvc --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/mvc <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
C:. ├───app │ ├───console │ ├───controllers │ ├───database │ │ ├───factories │ │ ├───migrations │ │ ├───schema │ │ └───seeds │ ├───helpers │ ├───models │ ├───routes │ └───views │ ├───css │ └───errors ├───config ├───lib ├───public │ └───assets │ ├───css │ └───img ├───storage │ ├───app │ │ └───public │ ├───framework │ │ └───views │ └───logs └───vendor
This directory structure is our opinionated way of organizing your MVC application. It is a blend of the best practices from different frameworks like Ruby on Rails and Laravel and some of our own experience building applications.
To run your Leaf MVC application, use
php leaf serve
Or with the Leaf CLI
leaf serve
📓 Learning Leaf MVC
- Leaf MVC has a very easy to understand documentation which contains information on all operations in Leaf MVC.
- Since Leaf MVC 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
😇 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
We are committed to keeping Leaf open-source and free, but maintaining and developing new features now requires significant time and resources. As the project has grown, so have the costs, which have been mostly covered by the team. To sustain and grow Leaf, we need your help to support full-time maintainers.
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 ❤️