public function handle($request, Closure $next)
{
if ($this->guard->guest()) {
if ($request->ajax() || $request->wantsJson()) {
return response('Unauthorized.', 401);
} else {
return redirect()->guest(URL::route('auth'));
}
}
}