Auth :: loginUsingId does not work in Lumen

1

I'm trying to use the Auth::loginUsingId method in Lumen, but I get the following error:

  

(1/1) BadMethodCallException Method loginUsingId does not exist. in   Macroable.php (line 74) at RequestGuard-> __ call ('loginUsingId',   array (1)) in AuthManager.php (line 294)

I tested using the same method in a clean installation of Laravel and it works. Could someone help me?

    
asked by anonymous 16.04.2018 / 21:32

1 answer

0

In the file bootstrap/app.php you should be commenting the use of Facades in Lumen then uncomment the line in this way:

looks like this:

// $app->withFacades();
// $app->withEloquent();

uncomment

$app->withFacades(); // habilitando o Facade
$app->withEloquent(); // habilitando o uso do Eloquent

restart the server

    
16.04.2018 / 23:21