@@ -43,6 +43,9 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | + /** |
|
| 47 | + * @param integer $count |
|
| 48 | + */ |
|
| 46 | 49 | public function topReferers($count) |
| 47 | 50 | { |
| 48 | 51 | $analytics = $this->model->where('created_at', '>', Carbon::now()->subDays($count))->get(); |
@@ -51,6 +54,9 @@ discard block |
||
| 51 | 54 | return $this->convertDataToItems($data, 'referer', ['unknown' => 0]); |
| 52 | 55 | } |
| 53 | 56 | |
| 57 | + /** |
|
| 58 | + * @param integer $count |
|
| 59 | + */ |
|
| 54 | 60 | public function topPages($count) |
| 55 | 61 | { |
| 56 | 62 | $analytics = $this->model->where('created_at', '>', Carbon::now()->subDays($count))->get(); |
@@ -59,6 +65,9 @@ discard block |
||
| 59 | 65 | return $this->convertDataToItems($data, 'uri'); |
| 60 | 66 | } |
| 61 | 67 | |
| 68 | + /** |
|
| 69 | + * @param integer $count |
|
| 70 | + */ |
|
| 62 | 71 | public function topBrowsers($count) |
| 63 | 72 | { |
| 64 | 73 | $analytics = $this->model->where('created_at', '>', Carbon::now()->subDays($count))->get(); |
@@ -74,6 +83,9 @@ discard block |
||
| 74 | 83 | return $browsers; |
| 75 | 84 | } |
| 76 | 85 | |
| 86 | + /** |
|
| 87 | + * @param string $key |
|
| 88 | + */ |
|
| 77 | 89 | public function convertDataToItems($data, $key, $conversions = []) |
| 78 | 90 | { |
| 79 | 91 | if (!isset($conversions['unknown'])) { |
@@ -103,6 +115,9 @@ discard block |
||
| 103 | 115 | return $conversions; |
| 104 | 116 | } |
| 105 | 117 | |
| 118 | + /** |
|
| 119 | + * @param integer $count |
|
| 120 | + */ |
|
| 106 | 121 | public function getDays($count) |
| 107 | 122 | { |
| 108 | 123 | $analytics = $this->model->where('created_at', '>', Carbon::now()->subDays($count)); |
@@ -132,6 +147,10 @@ discard block |
||
| 132 | 147 | ]; |
| 133 | 148 | } |
| 134 | 149 | |
| 150 | + /** |
|
| 151 | + * @param Carbon $startDate |
|
| 152 | + * @param Carbon $endDate |
|
| 153 | + */ |
|
| 135 | 154 | protected function getDateRange($startDate, $endDate) |
| 136 | 155 | { |
| 137 | 156 | $dates = []; |
@@ -364,12 +364,16 @@ |
||
| 364 | 364 | |
| 365 | 365 | /** |
| 366 | 366 | * Configs Paths |
| 367 | + * @param string $folder |
|
| 367 | 368 | */ |
| 368 | 369 | private function getResourcesPath($folder) |
| 369 | 370 | { |
| 370 | 371 | return __DIR__.'/../resources/'.$folder; |
| 371 | 372 | } |
| 372 | 373 | |
| 374 | + /** |
|
| 375 | + * @param string $folder |
|
| 376 | + */ |
|
| 373 | 377 | private function getPublishesPath($folder) |
| 374 | 378 | { |
| 375 | 379 | return __DIR__.'/../publishes/'.$folder; |