ryannerd/willow

Willow 框架,用于创建 ORM/RESTful API

安装: 214

依赖: 0

建议者: 0

安全: 0

星星: 19

关注者: 6

分支: 4

开放问题: 10

类型:项目

3.0.2 2021-06-13 22:08 UTC

README

License: MIT

willow Willow 是一种类型的女孩,她美丽、令人惊叹,有点特别,周围的人都喜欢她。大多数 willow 都可以成为你的好朋友,她什么都愿意做,她喜欢任何你抛向她的有趣事物...

~ Urban Dictionary

对于开发者来说,Willow 是一个用于快速创建基于 CRUD 的 RESTful API 的 有偏见的 PHP 框架。

Willow 是由 SlimEloquent ORM 结合 Robo 作为你的 婚礼策划师 而组成。

有关说明和入门,请参阅 Willow 框架用户指南

在此情况下,Willow 作为框架表现最佳

  • 您需要快速构建一个 RESTful 数据集中型 API
  • 您已经定义了数据库,并且已经设置了表
  • 您刚开始您的项目,需要 迅速行动

📃 要求

  • PHP 7.4+ (Willow 3.0+)
  • 数据库
    • MySQL 5.6+
    • SQLite3
    • Postgres (未经测试)
    • MSSQL (未经测试)
  • Composer (为了 Willow 最好地工作,必须全局安装)

💾 安装

要安装 Willow,请运行

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

这将创建一个 Willow 项目的骨架。Willow 尝试将 robo 链接。然后您可以使用 Willow (robo) 命令构建您的应用程序。

演示

./willow sample

在浏览器中的结果应该看起来像这样

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

Willow (robo) 命令

# 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

贡献

这样做

  1. 分叉此存储库
  2. 在您的分叉上做出更改
  3. 推送 PR

注意:主分支不是 master,而是 3.x,您应该将 PR 推送到那里。

特别感谢

Slim 框架

Illuminate / Eloquent ORM

Willow 图标由 Freepikwww.flaticon.com 制作,并受 CC 3.0 BY 许可。