original_string: 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(),
                  ];
              });
      }
code: 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(),
                  ];
              });
      }
code_tokens: 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 ( ) , ] ; } ) ; }
docstring: Get the devices from sessions.
  
  @param  \Carbon\Carbon  $start
  @param  \Carbon\Carbon  $end
  
  @return \Illuminate\Support\Collection
docstring_tokens: Get the devices from sessions .