I have installed Lumen and trying to implement authentication.
I am using Laravel Framework version Lumen (5.3.3) (Laravel Components 5.3.*).
In app.php I have uncommented the following.
$app->withFacades();
$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
$app->register(App\Providers\AuthServiceProvider::class);
In \app\Providers\AuthServiceProvider.php
public function boot() {
$this->app['auth']->viaRequest('api', function ($request) {
if ($request->input('api_token')) {
return User::where('api_token', $request->input('api_token'))->first();
}
});
}
Here when I debugged, viaRequest
method is not getting executed.