@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var array Plugin dependencies |
| 16 | 16 | */ |
| 17 | - public $require = ['RainLab.User']; |
|
| 17 | + public $require = [ 'RainLab.User' ]; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Returns information about this plugin. |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * Log user after login |
| 38 | 38 | */ |
| 39 | - Event::listen('rainlab.user.login', function ($user) { |
|
| 39 | + Event::listen('rainlab.user.login', function($user) { |
|
| 40 | 40 | AccessLog::add($user); |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * @var array Relations |
| 20 | 20 | */ |
| 21 | 21 | public $belongsTo = [ |
| 22 | - 'user' => ['RainLab\User\Models\User'] |
|
| 22 | + 'user' => [ 'RainLab\User\Models\User' ] |
|
| 23 | 23 | ]; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -21,11 +21,11 @@ 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(); |
|
| 28 | + $this->vars[ 'error' ] = $ex->getMessage(); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | return $this->makePartial('widget'); |
@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $log = AccessLog::all()->groupBy('user_id'); |
| 60 | 60 | |
| 61 | - $counts = []; |
|
| 61 | + $counts = [ ]; |
|
| 62 | 62 | $all = 0; |
| 63 | 63 | foreach ($log as $l) { |
| 64 | - $first = $l[0]; |
|
| 64 | + $first = $l[ 0 ]; |
|
| 65 | 65 | $user = $first->user; |
| 66 | 66 | $size = sizeof($l); |
| 67 | - $counts[] = [ |
|
| 67 | + $counts[ ] = [ |
|
| 68 | 68 | 'size' => $size, |
| 69 | 69 | 'id' => $first->user_id, |
| 70 | 70 | 'name' => $user->username |