我正在寻找在流明下面添加外观的位置。
'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/