ibandominguez/restup-back

关于该包最新版本(v0.4.2)没有可用的许可信息。

v0.4.2 2016-10-13 15:19 UTC

README

在单个文件中构建REST API。

使用示例

<?php

require __DIR__.'/../vendor/autoload.php';

use IbanDominguez\RestUp\App;

App::create([
  'JWT_KEY' => 'supersecret',
  'DB_HOST' => 'localhost',
  'DB_NAME' => 'prueba',
  'DB_USER' => 'root',
  'DB_PASS' => '',
])
->auth([
  'admin@email.com' => 'admin'
])
->add('books', [
  ['title' => 'title', 'type' => 'string', 'rules' => 'required'],
  ['title' => 'date',  'type' => 'date',   'rules' => 'required|date'],
])
->add('posts', [
  ['title' => 'title', 'type' => 'string', 'rules' => 'required'],
  ['title' => 'body',  'type' => 'string'],
  ['title' => 'date',  'type' => 'date',   'rules' => 'date']
], [
  'except'    => ['show'],
  'protected' => ['save']
])
->run(true);

测试

git clone https://github.com/ibandominguez/restup-back.git
cd restup-back
phpunit

路线图

  • 图片上传
  • JWT认证可配置路由

贡献者

  • Ibán Domínguez

许可

Mit