ryannerd/willow

Willow Framework for creating ORM/RESTful APIs

3.0.2 2021-06-13 22:08 UTC

README

License: MIT

willow Willow is a type a girl who is beautiful and amazing and is kinda a special person and loved by everyone around her most willows can be your best of friends she's up for anything and she's loves anything fun you throw at her...

~ Urban Dictionary

For developers, Willow is an opinionated PHP framework used to quickly create CRUD based RESTful APIs.

Willow is a marriage 💒 between Slim and Eloquent ORM with Robo as your wedding planner.

For instructions and getting started see the Willow Framework User Guide

Willow works best as a framework in this situation:

  • You need to quickly spin up a RESTful datacentric API
  • You have defined your database with your tables already in place
  • You are just starting your project and need to hit the ground running

📃 Requirements

  • PHP 7.4+ (Willow 3.0+)
  • Databases:
    • MySQL 5.6+
    • SQLite3
    • Postgres (untested)
    • MSSQL (untested)
  • Composer (For Willow to work best this must be installed globally)
Notes
Willow will work on Windows only if running in the Windows Subsystem for Linux (WSL)
Previous versions of Willow are no longer supported (sorry I don't have the bandwidth to support these)

💾 Installation

To install Willow run:

composer create-project --ignore-platform-reqs ryannerd/willow:^3 [your-project-name]
cd [your-project-name]

This will create a skeleton Willow project. Willow tries to symlink to robo You can then use Willow (robo) commands to build your app.

Demo

./willow sample

The result in your browser should look something like this:

{
  "authenticated": true,
  "success": true,
  "status": 200,
  "data": {
    "id": "hello-world"
  },
  "missing": [ ],
  "message": "Sample test",
  "timestamp": 1556903905
}

Willow (robo) Commands

# Documentation and demo
./willow docs   # bring up the documentation web page
./willow list   # list all available Willow commands
./willow sample # launch the sample API in a web browser
./willow banner # show the Willow introductory banner

# Willow core commands
./willow make   # Connects to your database and builds routes, controllers, models, actions, etc.
./willow reset  # Resets the project back to factory defaults
./willow eject  # Removes the sample artifacts from the project

# Database commands
./willow tables  # list all the tables in the database
./willow details # Show details (column names and types) of a selected table

Contributing

Do this:

  1. Fork this repo
  2. Make changes on your fork
  3. Push a PR

Note: the main branch isn't master it's 3.x which is where you want to push your PR.

Special thanks to:

The Slim Framework

Illuminate / Eloquent ORM

Willow icon made by Freepik from www.flaticon.com is licensed by CC 3.0 BY