public static function track()
    {
        $ip = Request::server('REMOTE_ADDR');
        $online = time();
        $url = URL::full();
        $path = Request::path();

        $visited = static::whereIp($ip)->today()->first();
        if (!empty($visited)) {
            $visited->update([
                'online' => $online,
                'hits' => $visited->hits + 1,
                'url' => $url,
                'path' => $path,
            ]);
        } else {
            static::createNewVisitor();
        }
    }
public static function track()
    {
        $ip = Request::server('REMOTE_ADDR');
        $online = time();
        $url = URL::full();
        $path = Request::path();

        $visited = static::whereIp($ip)->today()->first();
        if (!empty($visited)) {
            $visited->update([
                'online' => $online,
                'hits' => $visited->hits + 1,
                'url' => $url,
                'path' => $path,
            ]);
        } else {
            static::createNewVisitor();
        }
    }
public static function track ( ) { $ ip = Request :: server ( 'REMOTE_ADDR' ) ; $ online = time ( ) ; $ url = URL :: full ( ) ; $ path = Request :: path ( ) ; $ visited = static :: whereIp ( $ ip ) -> today ( ) -> first ( ) ; if ( ! empty ( $ visited ) ) { $ visited -> update ( [ 'online' => $ online , 'hits' => $ visited -> hits + 1 , 'url' => $ url , 'path' => $ path , ] ) ; } else { static :: createNewVisitor ( ) ; } }
Track hits online visitors.
Track hits online visitors .