iramgutierrez/lumen-resource-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iramgutierrez/lumen-resource-api

Composer 安装命令:

composer require iramgutierrez/lumen-resource-api

包简介

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

README 文档

README

Software License

Total Downloads

Full resource generator for API RESTful,

This package implements the layers pattern design, include:

  • Entity
  • Controller
  • Manager
  • Validator
  • Repository
  • Migration
  • Route
  • Documentation (Require apidocjs installed)

Installation

Add the following line to your composer.json file:

"iramgutierrez/lumen-resource-api": "1.3.*"

Run composer update to get the package.

Once composer has installed the package add this line of code in your bootstrap/app.php file:

$app->register(\IramGutierrez\API\APIServiceProvider::class);

Migrations and Configuration Publishing

Add this line of code to the $commands protected array located in your app/Console/Kernel.php file:

\Laravelista\LumenVendorPublish\VendorPublishCommand::class

Run php artisan vendor:publish to publish this package configuration and migrations. Afterwards you can edit the file config/resource_api.php to set the namespace for the resources generated.

Run migration to create required tables

php artisan migrate

Usage

Now, you should have available the Artisan command: create-resource-api and can be used like this:

php artisan create-resource-api {Entity}

Example

Run

php artisan create-resource-api Test

And, the command ask you for the table name:

Table name [tests]:

namespace:

Path name [API]:

prefix route:

Prefix route []:

if do you want generate documentation:

Generate documentation? (Require apidocjs) (yes/no) [yes]:

if do you want generate the migration file:

Generate migration? (yes/no) [yes]:

if do you want run migration:

Run migration? (yes/no) [yes]:

if do you want add the route resource in routes.php file:

Add routes resource? (yes/no) [yes]:

and if do you want add some middleware:

Middlewares or middleware groups (comma separated) []:

When the execution is finished, you should have available the following functional routes:

Route Method Uses Action
/tests GET API\TestController@index Request all tests
/tests POST API\TestController@store Store a test
/tests/:id GET API\TestController@show Request a specific test
/tests/:id PUT API\TestController@update Update a specific test
/tests/:id DELETE API\TestController@destroy Delete a specific test

License

The Lumen Resource API package is released under the MIT License.

统计信息

  • 总下载量: 77
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固