-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Before we really get started you should decide if Willow is a good framework for your situation. Willow works best in this situation:
- You need to hit the ground running by building a server side RESTful CRUD based service.
- You are just starting the back-end project.
- You have your database entities (tables/views) established on a MySQL or MariaDB server and you have admin credentials to the server.
If you answered yes to all three of these questions then Willow is a good choice.
Willow is a marriage between Slim 4 and the Illuminate Database; with Dependency Injection as your best man, Respect\Validation as your bridesmaid, and Robo as your wedding planner.
Willow is an opinionated PHP framework used to quickly create CRUD based RESTful APIs. What we mean by opinionated is that Willow stresses convention over configuration. For example a Willow project has a specific directory structure that looks like this:
/app
/Controllers
/EntityNameDirectory1
EntityName1Controller.php
/EntityNameDirectory2
EntityName2Controller.php
/Main
App.php
/Middleware
ResponseBody.php
ResponseBodyFactory.php
Valdate.php
/Models
Model1.php
Model2.php
- PHP 7.1+
- MySQL 5.6+ (support is planned for Postgres, SQLite, and MSSQL)
- Composer (For Willow to work best this must be installed globally)
From a terminal / command window run:
composer create-project ryannerd/willow [your-project-name]
cd [your-project-name]
php -S localhost:8088 -t public
Then in your favorite web browser go to: localhost:8088/v1/sample/hello-world
The result should look something like this:
{
"authenticated": true,
"success": true,
"status": 200,
"data": {
"id": "hello-world"
},
"missing": [ ],
"message": "Sample test",
"timestamp": 1556903905
}