gpt4 book ai didi

laravel - 在流明注册立面和服务提供商的位置

转载 作者:行者123 更新时间:2023-12-03 09:15:46 27 4
gpt4 key购买 nike

我正在寻找在流明下面添加外观的位置。

'JWTAuth' => 'Tymon\JWTAuth\Facades\JWTAuth'

已编辑

还在 bootstrap\app.php中注册服务提供商的位置
$app->register('Tymon\JWTAuth\Providers\JWTAuthServiceProvider');

请协助。

最佳答案

bootstrap/app.php中,确保您未评论:

$app->withFacades();

然后,注册您的类别名并检查它是否已经存在(否则您的测试将失败):
if (!class_exists('JWTAuth')) {
class_alias('Tymon\JWTAuth\Facades\JWTAuth', 'JWTAuth');
}

要注册您的 ServiceProvider,请检查您的 bootstrap/app.php:
/*
|--------------------------------------------------------------------------
| Register Service Providers
|--------------------------------------------------------------------------
|
| Here we will register all of the application's service providers which
| are used to bind services into the container. Service providers are
| totally optional, so you are not required to uncomment this line.
|
*/

// $app->register('App\Providers\AppServiceProvider');

// Add your service provider here
$app->register('Tymon\JWTAuth\Providers\JWTAuthServiceProvider');

更新#1

我制作了一个简单的样板 here,将Lumen与JWT和Dingo集成在一起。

关于laravel - 在流明注册立面和服务提供商的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30399766/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com