@@ -68,10 +68,11 @@ discard block |
||
68 | 68 | { |
69 | 69 | $device = Device::findOrFail($id); |
70 | 70 | $location = Location::where('id', $device->location_id)->first(); |
71 | - if ($location) |
|
72 | - $site = Site::where('id', $location->site_id)->first(); |
|
73 | - else |
|
74 | - $site = null; |
|
71 | + if ($location) { |
|
72 | + $site = Site::where('id', $location->site_id)->first(); |
|
73 | + } else { |
|
74 | + $site = null; |
|
75 | + } |
|
75 | 76 | |
76 | 77 | return view('device.edit', ['device' => $device, 'location' => $location, 'site' => $site]); |
77 | 78 | } |
@@ -155,8 +156,7 @@ discard block |
||
155 | 156 | { |
156 | 157 | // if the user was already deleted then permananetly delete it |
157 | 158 | Device::destroy($id); |
158 | - } |
|
159 | - else |
|
159 | + } else |
|
160 | 160 | { |
161 | 161 | //Remove the location from the device |
162 | 162 | $oldLocation_id = $device->location_id; |