mstaack/lumen-api-starter

该软件包已被废弃,不再维护。未建议替代软件包。

API的Lumen启动器

安装: 10

依赖: 0

建议者: 0

安全: 0

星级: 56

观察者: 5

分支: 14

开放问题: 1

类型:项目

v2.0 2019-03-25 19:06 UTC

This package is auto-updated.

Last update: 2020-09-10 15:41:44 UTC


README

Build Status

备注

  • 包含制作和路由命令,满足您的所有需求
  • 使用jwt令牌替代 paseto。阅读 Paseto

包含的软件包

安装

  • 运行 git clone git@github.com:mstaack/lumen-api-starter.git
  • 使用 rm -rf .git && git init 重新初始化您的存储库
  • 运行 composer install 安装依赖(考虑通过 vagrant up 使用homestead)
  • env.example 复制到 .env
  • 使用 composer keys 设置您的应用程序和认证密钥,并检查 .env 文件(通过composer钩自动完成)
  • 使用 artisan migrate --seed 运行迁移和种子(在您的虚拟机中使用 vagrant ssh
  • 在种子过程中创建了一个默认用户: demo@demo.com / password
  • 要快速启动开发服务器,请运行 ./artisan serve(或通过 homestead.test 在虚拟机中运行)
  • 在添加模型时,请考虑运行 composer meta 以获得更好的自动完成(通过composer钩自动完成)
  • 在vagrant的代码目录中运行包含的测试 phpunit
  • 使用 artisan apidoc:generate 生成您的API文档

路由

➜  lumen-api-starter git:(update-5.8) ✗ ./artisan route:list
+------+--------------------------------+-----------------------+-------------------------------------+-----------------+--------------------------+
| Verb | Path                           | NamedRoute            | Controller                          | Action          | Middleware               |
+------+--------------------------------+-----------------------+-------------------------------------+-----------------+--------------------------+
| GET  | /                              |                       | None                                | Closure         |                          |
| POST | /auth/register                 | auth.register         | App\Http\Controllers\AuthController | register        |                          |
| POST | /auth/login                    | auth.login            | App\Http\Controllers\AuthController | login           |                          |
| GET  | /auth/verify/{token}           | auth.verify           | App\Http\Controllers\AuthController | verify          |                          |
| POST | /auth/password/forgot          | auth.password.forgot  | App\Http\Controllers\AuthController | forgotPassword  |                          |
| POST | /auth/password/recover/{token} | auth.password.recover | App\Http\Controllers\AuthController | recoverPassword |                          |
| GET  | /auth/user                     | auth.user             | App\Http\Controllers\AuthController | getUser         | auth                     |
| GET  | /admin                         |                       | None                                | Closure         | auth, role:administrator |
+------+--------------------------------+-----------------------+-------------------------------------+-----------------+--------------------------+

Artisan命令

➜  lumen-api-starter git:(master) ./artisan 
Laravel Framework Lumen (5.6.4) (Laravel Components 5.6.*)

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  clear-compiled            Remove the compiled class file
  dump-server               Start the dump server to collect dump information.
  help                      Displays help for a command
  list                      Lists commands
  migrate                   Run the database migrations
  optimize                  Optimize the framework for better performance
  serve                     Serve the application on the PHP development server
  tinker                    Interact with your application
 auth
  auth:clear-resets         Flush expired password reset tokens
  auth:generate-paseto-key  Creates a new authentication key for paseto
 cache
  cache:clear               Flush the application cache
  cache:forget              Remove an item from the cache
  cache:table               Create a migration for the cache database table
 clockwork
  clockwork:clean           Cleans Clockwork request metadata
 db
  db:seed                   Seed the database with records
 ide-helper
  ide-helper:eloquent       Add \Eloquent helper to \Eloquent\Model
  ide-helper:generate       Generate a new IDE Helper file.
  ide-helper:meta           Generate metadata for PhpStorm
  ide-helper:models         Generate autocompletion for models
 key
  key:generate              Set the application key
 make
  make:command              Create a new Artisan command
  make:controller           Create a new controller class
  make:event                Create a new event class
  make:job                  Create a new job class
  make:listener             Create a new event listener class
  make:mail                 Create a new email class
  make:middleware           Create a new middleware class
  make:migration            Create a new migration file
  make:model                Create a new Eloquent model class
  make:policy               Create a new policy class
  make:provider             Create a new service provider class
  make:request              Create a new form request class
  make:resource             Create a new resource
  make:seeder               Create a new seeder class
  make:test                 Create a new test class
 migrate
  migrate:fresh             Drop all tables and re-run all migrations
  migrate:install           Create the migration repository
  migrate:refresh           Reset and re-run all migrations
  migrate:reset             Rollback all database migrations
  migrate:rollback          Rollback the last database migration
  migrate:status            Show the status of each migration
 queue
  queue:failed              List all of the failed queue jobs
  queue:failed-table        Create a migration for the failed queue jobs database table
  queue:flush               Flush all of the failed queue jobs
  queue:forget              Delete a failed queue job
  queue:listen              Listen to a given queue
  queue:restart             Restart queue worker daemons after their current job
  queue:retry               Retry a failed queue job
  queue:table               Create a migration for the queue jobs database table
  queue:work                Start processing jobs on the queue as a daemon
 route
  route:list                Display all registered routes.
 schedule
  schedule:run              Run the scheduled commands

生成的文档截图

image