wantsJson()) { return response()->json([ 'RESULT' => "UNAUTHORIZED", ]); } else { abort(403); } } return $next($request); } }