alifcapital / lumen-user-service-client

Lumen 客户端,用于 https://github.com/alifcapital/alifcore-service-user

dev-master 2022-03-30 16:39 UTC

This package is auto-updated.

Last update: 2024-09-29 05:56:50 UTC


README

Lumen 8 的用户客户端 0.1

安装

将以下行添加到 composer.json 文件中

composer require alifcapital/alifcore-service-user-client-lumen   

在 Register Service Providers 部分添加以下行 (bootstrap/app.php)

$app->register(AlifCapital\UserServiceClient\ServiceProvider::class);

添加 routeMiddleware (bootstrap\app.php)

 $app->routeMiddleware([
     'auth' => App\Http\Middleware\Authenticate::class,
     'role' => AlifCapital\UserServiceClient\Http\Middleware\RoleMiddleware::class
 ]);

配置

  • 运行 php artisan user_client:publish-config 以发布配置 (config/user_client.php)

在 Register configure 部分添加以下行 (bootstrap/app.php)

$app->configure('user_client');   

在 Environments (.env) 中添加以下行

USER_CLIENT_SERVICE_NAME=alif-shop-settings #(every service had unique service_name)
USER_SERVICE_BASE_URL={url}/service_user #(URL of user service)
USER_CLIENT_PUBLIC_KEY_TTL=60 #CACHE IN SECOUNDS 

迁移

    php artisan migrate