url(), '_debugbar') === false) { $queries = DB::getQueryLog(); $count = count($queries); $timeEnd = microtime(true); $time = $timeEnd - LARAVEL_START; if ($count > 175) { nlog("Query count = {$count}"); nlog($queries); } $ip = ''; if ($request->hasHeader('Cf-Connecting-Ip')) { $ip = $request->header('Cf-Connecting-Ip'); } elseif ($request->hasHeader('X-Forwarded-For')) { $ip = $request->header('Cf-Connecting-Ip'); } else { $ip = $request->ip(); } $client_version = $request->server('HTTP_USER_AGENT'); $platform = ''; if ($request->hasHeader('X-CLIENT-PLATFORM')) { $platform = $request->header('X-CLIENT-PLATFORM'); } elseif($request->hasHeader('X-React')) { $platform = 'react'; } if ($request->hasHeader('X-CLIENT-VERSION')) { $client_version = $request->header('X-CLIENT-VERSION'); } LightLogs::create(new DbQuery($request->method(), substr(urldecode($request->url()), 0, 180), $count, $time, $ip, $client_version, $platform)) ->batch(); } } }