I think you can change a bit standard auth middleware (https://github.com/laravel/laravel/blob/master/app/Http/Middleware/Authenticate.php) and check your server variable. If it's null then return response('Unauthorized.', 401) or pass the request otherwise.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community