Translate AuthServiceProvider from Lumen to Laravel

0

I have already researched the entire documentation but can find no way to make this AuthServiceProvider work in Laravel 5.6 in the same way it works in Lumen 5.4.

Auth::viaRequest('api', function ($request) {
   if (($userId = $request->headers->get('x-authenticated-userid')) && ($client_id = $request->headers->get('x-consumer-username'))) {
      return User::where([['client_id', $client_id],['external_id', $userId]])->firstOrFail();
   }
});
    
asked by anonymous 20.04.2018 / 02:04

0 answers