@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function map(Router $router) |
| 39 | 39 | { |
| 40 | - $router->group(['namespace' => $this->namespace], function ($router) { |
|
| 40 | + $router->group(['namespace' => $this->namespace], function($router) { |
|
| 41 | 41 | require app_path('Http/routes.php'); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | public function list_devices(Request $request) { |
| 20 | 20 | if ($request->user()->level >= 10 || $request->user()->level == 5) { |
| 21 | 21 | return Device::all(); |
| 22 | - } |
|
| 23 | - else { |
|
| 22 | + } else { |
|
| 24 | 23 | return User::find($request->user()->user_id)->devices()->get(); |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | public function list_ports(Request $request) { |
| 32 | 31 | if ($request->user()->level >= 10 || $request->user()->level == 5) { |
| 33 | 32 | return Port::all(); |
| 34 | - } |
|
| 35 | - else { |
|
| 33 | + } else { |
|
| 36 | 34 | return User::find($request->user()->user_id)->ports()->get(); |
| 37 | 35 | } |
| 38 | 36 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | } |
| 68 | 68 | else { |
| 69 | 69 | $user = User::find($request->user()->user_id); |
| 70 | - $device = $user->devices()->find($id); |
|
| 70 | + $device = $user->devices()->find($id); |
|
| 71 | 71 | } |
| 72 | 72 | // morph the data as required |
| 73 | 73 | if ($request->query('displayFormat') == 'link') { |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | public function list_devices(Request $request) { |
| 20 | 20 | if ($request->user()->level >= 10 || $request->user()->level == 5) { |
| 21 | 21 | return Device::all(); |
| 22 | - } |
|
| 23 | - else { |
|
| 22 | + } else { |
|
| 24 | 23 | return User::find($request->user()->user_id)->devices()->get(); |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | public function list_ports(Request $request) { |
| 32 | 31 | if ($request->user()->level >= 10 || $request->user()->level == 5) { |
| 33 | 32 | return Port::all(); |
| 34 | - } |
|
| 35 | - else { |
|
| 33 | + } else { |
|
| 36 | 34 | return User::find($request->user()->user_id)->ports()->get(); |
| 37 | 35 | } |
| 38 | 36 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | public function index(Request $request) |
| 21 | 21 | { |
| 22 | 22 | if ($request->user()->hasGlobalRead()) { |
| 23 | - return Port::with(array('device'=>function($query){ |
|
| 23 | + return Port::with(array('device'=>function($query) { |
|
| 24 | 24 | $query->select('device_id', 'hostname'); |
| 25 | 25 | }))->get(); |
| 26 | 26 | } |