Where to register Facades & Service Providers in Lumen

后端 未结 3 983
情书的邮戳
情书的邮戳 2021-01-31 08:33

I Am looking for where to add the facade below in Lumen.

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

EDITED

Also where to re

3条回答
  •  旧时难觅i
    2021-01-31 09:31

    To register a facade with an alias, go to bootstrap/app.php and uncomment:

    $app->withFacades();
    

    ... it instructs the framework to start with facades. To add your facades, just put them in an array and pass the array as a second argument, while setting the first argument to true, as follows:

    $app->withFacades(true, [
        'Tymon\JWTAuth\Facades\JWTAuth' => 'JWTAuth',
        'facade' => 'alias',
    ]);
    

    To register a service provider, in the same file, scroll down to a relevant comment section and add the following line:

    $app->register(Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class);
    

提交回复
热议问题