/** * [updateVisitor description] * @param [type] $cvuid [description] * @return [type] [description] */ public function updateVisitor($cvuid) { // TODO // // Fixa bättre kakhantering. Just nu lagras id i klartext i javascriptvariabel. // Hämta istället den krypterade kakan som innehåller user id. // // $v = Visitor::where('session', $cvuid)->first(); $v->touch(); $dn = date('Y-m-d H:i:s', time() - 10); $v2 = Visitor::where('updated_at', '<', $dn)->delete(); $count = Visitor::all()->count(); return $count; }
/** * Reports Handlers... * */ public function reports() { $visitors = Visitor::all(); return Response::json(array('visitors' => $visitors)); }