Skip to content
Ryan Jentzsch edited this page May 8, 2019 · 6 revisions

🕮 Willow Framework Guide

Is Willow for you❔

Before we really get started you should decide if Willow is a good framework for your situation. Willow works best in this situation:

  1. You need to hit the ground running by building a server side RESTful CRUD based service.
  2. You are just starting the back-end project.
  3. 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.

💒 What is the Willow Framework?

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.

🖽 An opinionated framework

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

📃 Requirements

  • 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)

💾 Installation

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
}

Next: Initializing your project

Clone this wiki locally