'Invalid Token', 'errors' => [] ]; if ($request->header('X-API-COMPANY_KEY') && config('ninja.db.multi_db_enabled')) { if (! MultiDB::findAndSetDbByCompanyKey($request->header('X-API-COMPANY_KEY'))) { return response()->json($error, 403); } } elseif (!config('ninja.db.multi_db_enabled')) { return $next($request); } else { return response()->json($error, 403); } return $next($request); } }