1 | <?php namespace Arcanesoft\Tracker\ViewComposers\Dashboard; |
||
16 | class DevicesRatioComposer extends AbstractViewComposer |
||
17 | { |
||
18 | /* ------------------------------------------------------------------------------------------------ |
||
19 | | Constants |
||
20 | | ------------------------------------------------------------------------------------------------ |
||
21 | */ |
||
22 | const VIEW = 'tracker::foundation._composers.dashboard.devices-ratio-chart'; |
||
23 | |||
24 | /* ------------------------------------------------------------------------------------------------ |
||
25 | | Main Functions |
||
26 | | ------------------------------------------------------------------------------------------------ |
||
27 | */ |
||
28 | /** |
||
29 | * Compose the view. |
||
30 | * |
||
31 | * @param \Illuminate\Contracts\View\View $view |
||
32 | */ |
||
33 | public function compose(View $view) |
||
49 | |||
50 | /* ------------------------------------------------------------------------------------------------ |
||
51 | | Other Functions |
||
52 | | ------------------------------------------------------------------------------------------------ |
||
53 | */ |
||
54 | /** |
||
55 | * Get the devices from sessions. |
||
56 | * |
||
57 | * @param \Carbon\Carbon $start |
||
58 | * @param \Carbon\Carbon $end |
||
59 | * |
||
60 | * @return \Illuminate\Support\Collection |
||
61 | */ |
||
62 | protected function getDevicesFromSessions(Carbon $start, Carbon $end) |
||
72 | |||
73 | /** |
||
74 | * Get the computers count. |
||
75 | * |
||
76 | * @param \Illuminate\Support\Collection $devices |
||
77 | * |
||
78 | * @return int |
||
79 | */ |
||
80 | protected function getComputersCount(Collection $devices) |
||
86 | |||
87 | /** |
||
88 | * Get the tablets count. |
||
89 | * |
||
90 | * @param \Illuminate\Support\Collection $devices |
||
91 | * |
||
92 | * @return int |
||
93 | */ |
||
94 | protected function getTabletsCount(Collection $devices) |
||
100 | |||
101 | /** |
||
102 | * Get the phones count. |
||
103 | * |
||
104 | * @param \Illuminate\Support\Collection $devices |
||
105 | * |
||
106 | * @return int |
||
107 | */ |
||
108 | protected function getPhonesCount(Collection $devices) |
||
114 | |||
115 | /** |
||
116 | * Get the computers count. |
||
117 | * |
||
118 | * @param \Illuminate\Support\Collection $devices |
||
119 | * |
||
120 | * @return int |
||
121 | */ |
||
122 | protected function getUnavailableCount(Collection $devices) |
||
128 | } |
||
129 |