private function getCountriesCountFromSessions(Carbon $start, Carbon $end)
    {
        return $this->getVisitorsFilteredByDateRange($start, $end)
            ->transform(function (Visitor $visitor) {
                return $visitor->hasGeoip()
                    ? [
                        'code'  => $visitor->geoip->iso_code,
                        'geoip' => $visitor->geoip,
                    ]
                    : [
                        'code'  => 'undefined',
                        'geoip' => null,
                    ];
            })
            ->groupBy('code')
            ->transform(function (Collection $items, $key) {
                return ($key === 'undefined')
                    ? [
                        'code'  => null,
                        'name'  => trans('tracker::generals.undefined'),
                        'count' => $items->count(),
                    ]
                    : [
                        'code'  => $key,
                        'name'  => $items->first()['geoip']->country,
                        'count' => $items->count(),
                    ];
            });
    }