',date("Y-m-d H:i:s" ,time() - (60*60))) ->where('ip', $request->ip())->first(); if ($visitor === null) { $visitor = new Visitor(); $visitor->ip = $request->ip(); $visitor->browser = TVisitor::DetectBrowserI(); $visitor->os = TVisitor::DetectOSI(); $visitor->version = TVisitor::BrowserVersion(); $visitor->keywords = TVisitor::GetKeyword(); $visitor->is_mobile = TVisitor::IsMobile(); $visitor->save(); }else{ $visitor->increment('visit'); } return $next($request); } }