@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * |
| 82 | 82 | * @param Request $request |
| 83 | 83 | * @param string $id |
| 84 | - * @return Response |
|
| 84 | + * @return \Illuminate\Http\RedirectResponse |
|
| 85 | 85 | */ |
| 86 | 86 | public function update(Request $request, $id) |
| 87 | 87 | { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | * |
| 146 | 146 | * @param Request $request |
| 147 | 147 | * @param string $id |
| 148 | - * @return Response |
|
| 148 | + * @return \Illuminate\Http\RedirectResponse |
|
| 149 | 149 | */ |
| 150 | 150 | public function destroy(Request $request, $id) |
| 151 | 151 | { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $device = Device::findOrFail($id); |
| 56 | 56 | |
| 57 | - return view('device.show', ['device' => $device]); |
|
| 57 | + return view('device.show', [ 'device' => $device ]); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | else |
| 74 | 74 | $site = null; |
| 75 | 75 | |
| 76 | - return view('device.edit', ['device' => $device, 'location' => $location, 'site' => $site]); |
|
| 76 | + return view('device.edit', [ 'device' => $device, 'location' => $location, 'site' => $site ]); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | { |
| 184 | 184 | $device = Device::findOrFail($id); |
| 185 | 185 | |
| 186 | - return view('device.remove', ['device' => $device]); |
|
| 186 | + return view('device.remove', [ 'device' => $device ]); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -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; |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | return $this->datatables |
| 18 | 18 | ->eloquent($this->query()) |
| 19 | 19 | ->addColumn('action', 'device.action') |
| 20 | - ->blacklist(['action']) |
|
| 21 | - ->setRowClass(function ($device) { |
|
| 20 | + ->blacklist([ 'action' ]) |
|
| 21 | + ->setRowClass(function($device) { |
|
| 22 | 22 | return $device->trashed() ? 'alert-danger' : ""; |
| 23 | 23 | }); |
| 24 | 24 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | //->addAction(['width' => '160px']) |
| 58 | 58 | ->parameters([ |
| 59 | 59 | 'dom' => 'Bfrtip', |
| 60 | - 'order' => [[0, 'asc']], |
|
| 60 | + 'order' => [ [ 0, 'asc' ] ], |
|
| 61 | 61 | 'buttons' => [ |
| 62 | 62 | 'export', |
| 63 | 63 | 'print', |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | 'name', |
| 84 | 84 | 'location', |
| 85 | 85 | 'site', |
| 86 | - ['name' => 'action', 'data' => 'action', 'title' => 'Actions', 'render' => null, 'searchable' => false, 'orderable' => false, 'exportable' => false, 'printable' => true, 'footer' => ''], |
|
| 86 | + [ 'name' => 'action', 'data' => 'action', 'title' => 'Actions', 'render' => null, 'searchable' => false, 'orderable' => false, 'exportable' => false, 'printable' => true, 'footer' => '' ], |
|
| 87 | 87 | ]; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -94,6 +94,6 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | protected function filename() |
| 96 | 96 | { |
| 97 | - return 'devices_' . time(); |
|
| 97 | + return 'devices_'.time(); |
|
| 98 | 98 | } |
| 99 | 99 | } |