Completed
Push — master ( 5c8869...b51238 )
by Brandon
20s
created
app/Http/Controllers/DashboardController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     
39 39
         $data = $this->dashData($site, $location, $device);
40 40
         
41
-        return view('dashboard.index', [ 'active_device' => $data[0], 'devices' => $data[1], 'locations' => $data[2], 'sites' => $data[3] ]);
41
+        return view('dashboard.index', [ 'active_device' => $data[ 0 ], 'devices' => $data[ 1 ], 'locations' => $data[ 2 ], 'sites' => $data[ 3 ] ]);
42 42
     }
43 43
     
44 44
     /**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         
100 100
         $data = $this->dashData($site, $location, $device);
101 101
         
102
-        return response()->json([ 'active_device' => $data[0], 'devices' => $data[1], 'locations' => $data[2], 'sites' => $data[3] ]);
102
+        return response()->json([ 'active_device' => $data[ 0 ], 'devices' => $data[ 1 ], 'locations' => $data[ 2 ], 'sites' => $data[ 3 ] ]);
103 103
     }
104 104
     
105 105
     /**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         
120 120
         $data = $this->dashData($site, $location, $device);
121 121
         
122
-        return response()->json([ 'active_device' => $data[0], 'devices' => $data[1], 'locations' => $data[2], 'sites' => $data[3] ]);
122
+        return response()->json([ 'active_device' => $data[ 0 ], 'devices' => $data[ 1 ], 'locations' => $data[ 2 ], 'sites' => $data[ 3 ] ]);
123 123
     }
124 124
     
125 125
     /**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         
140 140
         $data = $this->dashData($site, $location, $device);
141 141
         
142
-        return response()->json([ 'active_device' => $data[0], 'devices' => $data[1], 'locations' => $data[2], 'sites' => $data[3] ]);
142
+        return response()->json([ 'active_device' => $data[ 0 ], 'devices' => $data[ 1 ], 'locations' => $data[ 2 ], 'sites' => $data[ 3 ] ]);
143 143
     }
144 144
     
145 145
     /**
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
         //Get all the devices that belong to the given location ordered by name
162 162
         $devices = $location->devices()->publicDashData()->orderBy('name', 'ASC')->get();
163 163
         
164
-        $active_device = collect([$device, $location, $site]);
164
+        $active_device = collect([ $device, $location, $site ]);
165 165
         
166
-        return collect([$active_device, $devices, $locations, $sites]);
166
+        return collect([ $active_device, $devices, $locations, $sites ]);
167 167
     }
168 168
     
169 169
     /**
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             return response()->json("Device is currently in use.", 403);
185 185
         
186 186
         //1 = open, 2 = close, 3 = lock
187
-        switch($request->command)
187
+        switch ($request->command)
188 188
         {
189 189
             case 1:
190 190
                 $device->cover_command = 'open';
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
             
221 221
             //Check if the current time is during the open schedule or not
222 222
             if (($time_now > $open_time) && ($time_now < $close_time))
223
-                $command =  'open';
223
+                $command = 'open';
224 224
             else
225
-                $command =  'close';
225
+                $command = 'close';
226 226
         }
227 227
         else
228
-            $command =  'lock';
228
+            $command = 'lock';
229 229
         
230 230
         return $command;
231 231
     }
Please login to merge, or discard this patch.