@@ -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 | } |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | if (Auth::guard($guard)->guest()) { |
| 21 | 21 | if ($request->ajax() || $request->wantsJson()) { |
| 22 | 22 | return response('Unauthorized.', 401); |
| 23 | - } else { |
|
| 23 | + } |
|
| 24 | + else { |
|
| 24 | 25 | return redirect()->guest('login'); |
| 25 | 26 | } |
| 26 | 27 | } |
@@ -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') { |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use App\User; |
| 7 | 7 | use App\Port; |
| 8 | 8 | use App\Api\Transformers\PortTransformer; |
| 9 | - |
|
| 10 | 9 | use Illuminate\Http\Request; |
| 11 | 10 | use Dingo\Api\Routing\Helpers; |
| 12 | 11 | use Illuminate\Support\Facades\Input; |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $ports = Port::all(); |
| 31 | 31 | } |
| 32 | 32 | else { |
| 33 | - $ports = Auth::user()->ports()->get(); |
|
| 33 | + $ports = Auth::user()->ports()->get(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | $includes = explode(',', Input::get('include')); |
@@ -2,12 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | -use App\User; |
|
| 6 | 5 | use Dingo\Api\Http; |
| 7 | 6 | use Dingo\Api\Routing\Helpers; |
| 8 | 7 | use Illuminate\Http\Request; |
| 9 | 8 | use JWTAuth; |
| 10 | -use Tymon\JWTAuth\Exceptions\JWTException; |
|
| 11 | 9 | |
| 12 | 10 | |
| 13 | 11 | class PortController extends Controller |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | // return view('ports.list', ['ports'=>$ports]); |
| 34 | 34 | |
| 35 | 35 | // FIXME: is this correct? |
| 36 | - $token = JWTAuth::fromUser(auth()->user()); |
|
| 36 | + $token = JWTAuth::fromUser(auth()->user()); |
|
| 37 | 37 | $ports = []; // empty table |
| 38 | 38 | |
| 39 | 39 | return view('ports.list', ['ports'=>$port, 'token'=>$token]); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Test if the User is an admin or demo. |
| 33 | 33 | * |
| 34 | - * @return \Illuminate\Database\Eloquent\Builder |
|
| 34 | + * @return boolean |
|
| 35 | 35 | */ |
| 36 | 36 | public function isAdmin() |
| 37 | 37 | { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * Test if this user has global read access |
| 43 | 43 | * these users have a level of 5, 10 or 11 (demo). |
| 44 | 44 | * |
| 45 | - * @return \Illuminate\Database\Eloquent\Builder |
|
| 45 | + * @return boolean |
|
| 46 | 46 | */ |
| 47 | 47 | public function hasGlobalRead() |
| 48 | 48 | { |