@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | public function render() |
22 | 22 | { |
23 | 23 | try { |
24 | - $this->vars['all'] = $this->getCounts()['all']; |
|
25 | - $this->vars['counts'] = $this->getCounts()['counts']; |
|
24 | + $this->vars[ 'all' ] = $this->getCounts()[ 'all' ]; |
|
25 | + $this->vars[ 'counts' ] = $this->getCounts()[ 'counts' ]; |
|
26 | 26 | |
27 | 27 | } catch (Exception $ex) { |
28 | - $this->vars['error'] = $ex->getMessage(); |
|
29 | - $this->vars['all'] = 0; |
|
30 | - $this->vars['counts'] = []; |
|
28 | + $this->vars[ 'error' ] = $ex->getMessage(); |
|
29 | + $this->vars[ 'all' ] = 0; |
|
30 | + $this->vars[ 'counts' ] = [ ]; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | return $this->makePartial('widget'); |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | { |
61 | 61 | $log = AccessLog::all()->groupBy('user_id'); |
62 | 62 | |
63 | - $counts = []; |
|
63 | + $counts = [ ]; |
|
64 | 64 | $all = 0; |
65 | 65 | foreach ($log as $l) { |
66 | - $first = $l[0]; |
|
66 | + $first = $l[ 0 ]; |
|
67 | 67 | $user = $first->user; |
68 | 68 | $size = sizeof($l); |
69 | - $counts[] = [ |
|
69 | + $counts[ ] = [ |
|
70 | 70 | 'size' => $size, |
71 | 71 | 'id' => $first->user_id, |
72 | 72 | 'name' => $user->username |