@@ -39,7 +39,8 @@ |
||
| 39 | 39 | |
| 40 | 40 | if ($user->hasGlobalRead()) { |
| 41 | 41 | $deviceQuery = Device::isNotIgnored(); |
| 42 | - } else { |
|
| 42 | + } |
|
| 43 | + else { |
|
| 43 | 44 | $deviceQuery = $user->devices()->isNotIgnored(); |
| 44 | 45 | } |
| 45 | 46 | $devices = $deviceQuery->get(['device_id', 'hostname', 'status', 'uptime'])->keyBy('device_id'); |
@@ -55,15 +55,18 @@ |
||
| 55 | 55 | if ($this->option('list') || is_null($this->option())) { |
| 56 | 56 | event(new ListDevices()); |
| 57 | 57 | echo "Sending Device List Event\n"; |
| 58 | - } else { |
|
| 58 | + } |
|
| 59 | + else { |
|
| 59 | 60 | // Fire off an event, just randomly grabbing the first user for now |
| 60 | 61 | if ($this->option('id') !== null) { |
| 61 | 62 | if ($this->option('id') == 'all') { |
| 62 | 63 | $devices = Device::all(); |
| 63 | - } else { |
|
| 64 | + } |
|
| 65 | + else { |
|
| 64 | 66 | $devices = [Device::find($this->option('id'))]; |
| 65 | 67 | } |
| 66 | - } else { |
|
| 68 | + } |
|
| 69 | + else { |
|
| 67 | 70 | $devices = [Device::first()]; |
| 68 | 71 | } |
| 69 | 72 | |