Package Data | |
---|---|
Maintainer Username: | virchow |
Package Create Date: | 2020-12-01 |
Package Last Update: | 2021-07-28 |
License: | MIT |
Last Refreshed: | 2024-11-17 03:07:02 |
Package Statistics | |
---|---|
Total Downloads: | 10 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 0 |
Total Forks: | 0 |
Total Open Issues: | 0 |
** 只是将lumen的常用的扩展做成自定义安装的形式 **
composer create-project virchow/virlumen-installer your-project
git clone https://github.com/wei199469/virlumen-installer.git your-project
composer run-script pre-install-cmd
Dingo-Api
Laravel 下知名扩展包 Dingo API 的中文文档 此扩展集成版本控制、用户认证、节点限流等常用功能,可作为统一风格的Api
JWT-Auth
Sentry-Laravel
Dingo-Api
在 boostrap/app.php
中添加$app->register(Dingo\Api\Provider\LumenServiceProvider::class);
创建自己的api路由,如
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1\Auth'], function ($api) {
$api->group(['prefix' => 'user'], function ($api) {
$api->post('login', 'AuthController@login');
$api->group(['middleware' => 'auth'], function($api){
$api->post('logout', 'AuthController@logout');
$api->post('refresh', 'AuthController@refresh');
$api->post('me', 'AuthController@me');
});
});
});
Jwt-Auth
取消 $app->routeMiddleware([ 'auth' => App\Http\Middleware\Authenticate::class ]);
的注释;
取消 $app->register(App\Providers\AuthServiceProvider::class);
的注释;
添加 $app->register(Tymon\JWTAuth\Providers\LumenServiceProvider::class);
;
[安装]: #安装 "安装跳转"
[configure]: #configure "配置"