protected function getDevicesFromSessions(Carbon $start, Carbon $end)
    {
        return $this->getVisitorsFilteredByDateRange($start, $end)
            ->filter(function (Visitor $session) {
                return $session->hasDevice();
            })
            ->transform(function (Visitor $session) {
                return $session->device;
            })
            ->groupBy('kind')
            ->transform(function (Collection $items, $key) {
                return [
                    'kind'  => trans("tracker::devices.kinds.$key"),
                    'count' => $items->count(),
                ];
            });
    }
protected function getDevicesFromSessions(Carbon $start, Carbon $end)
    {
        return $this->getVisitorsFilteredByDateRange($start, $end)
            ->filter(function (Visitor $session) {
                return $session->hasDevice();
            })
            ->transform(function (Visitor $session) {
                return $session->device;
            })
            ->groupBy('kind')
            ->transform(function (Collection $items, $key) {
                return [
                    'kind'  => trans("tracker::devices.kinds.$key"),
                    'count' => $items->count(),
                ];
            });
    }
protected function getDevicesFromSessions ( Carbon $ start , Carbon $ end ) { return $ this -> getVisitorsFilteredByDateRange ( $ start , $ end ) -> filter ( function ( Visitor $ session ) { return $ session -> hasDevice ( ) ; } ) -> transform ( function ( Visitor $ session ) { return $ session -> device ; } ) -> groupBy ( 'kind' ) -> transform ( function ( Collection $ items , $ key ) { return [ 'kind' => trans ( "tracker::devices.kinds.$key" ) , 'count' => $ items -> count ( ) , ] ; } ) ; }
Get the devices from sessions.

@param  \Carbon\Carbon  $start
@param  \Carbon\Carbon  $end

@return \Illuminate\Support\Collection
Get the devices from sessions .