@@ -30,14 +30,12 @@ discard block |
||
| 30 | 30 | $includes = explode(',', Input::get('include')); |
| 31 | 31 | if (in_array('device', $includes)) { |
| 32 | 32 | $ports = Port::with('device')->get(); |
| 33 | - } |
|
| 34 | - else { |
|
| 33 | + } else { |
|
| 35 | 34 | $ports = Port::all(); |
| 36 | 35 | } |
| 37 | 36 | return $this->response->collection($ports, new PortTransformer); |
| 38 | 37 | return $ports; |
| 39 | - } |
|
| 40 | - else { |
|
| 38 | + } else { |
|
| 41 | 39 | return Auth::user()->ports()->get(); |
| 42 | 40 | } |
| 43 | 41 | } |
@@ -73,8 +71,7 @@ discard block |
||
| 73 | 71 | { |
| 74 | 72 | if ($request->user()->hasGlobalRead()) { |
| 75 | 73 | return Port::find($id); |
| 76 | - } |
|
| 77 | - else { |
|
| 74 | + } else { |
|
| 78 | 75 | $user = User::find($request->user()->user_id); |
| 79 | 76 | return $user->ports()->find($id); |
| 80 | 77 | } |