Completed
Push — develop ( 86b217...3491c3 )
by Neil
07:46
created
app/Http/Controllers/HomeController.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,11 +3,8 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use Dingo\Api\Http;
6
-use Dingo\Api\Routing\Router;
7 6
 use Dingo\Api\Routing\Helpers;
8
-use App\Http\Requests;
9 7
 use Illuminate\Http\Request;
10
-use JWTAuth;
11 8
 
12 9
 class HomeController extends Controller
13 10
 {
Please login to merge, or discard this patch.
app/Api/Controllers/APIAuthController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
         try {
18 18
             // attempt to verify the credentials and create a token for the user
19
-            if (! $token = JWTAuth::attempt($credentials)) {
19
+            if (!$token = JWTAuth::attempt($credentials)) {
20 20
                 return response()->json(['error' => 'invalid_credentials'], 401);
21 21
             }
22 22
         } catch (JWTException $e) {
Please login to merge, or discard this patch.
app/Http/routes.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::group(['middleware' => ['web']], function () {
14
+Route::group(['middleware' => ['web']], function() {
15 15
     Route::auth();
16 16
     Route::get('/', 'HomeController@index');
17 17
     Route::get('/home', 'HomeController@index');
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 });
20 20
 
21 21
 $api = app('Dingo\Api\Routing\Router');
22
-$api->version('v1', function ($api) {
23
-    $api->post('auth',  'App\Api\Controllers\APIAuthController@authenticate');
24
-    $api->group(['middleware' => 'api.auth'], function ($api) {
22
+$api->version('v1', function($api) {
23
+    $api->post('auth', 'App\Api\Controllers\APIAuthController@authenticate');
24
+    $api->group(['middleware' => 'api.auth'], function($api) {
25 25
         $api->get('devices', 'App\Api\Controllers\APIController@list_devices');
26 26
     });
27 27
 });
Please login to merge, or discard this patch.
app/Providers/RouteServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Api/Controllers/APIController.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use App\Devices;
6 6
 use App\User;
7
-
8
-use App\Http\Requests;
9 7
 use Illuminate\Http\Request;
10 8
 
11 9
 class ApiController extends Controller
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
     public function list_devices(Request $request) {
18 18
         if ($request->user()->level >= 10 || $request->user()->level == 5) {
19 19
             return Devices::all();
20
-        }
21
-        else {
20
+        } else {
22 21
             return User::find($request->user()->user_id)->devices()->get();
23 22
         }
24 23
     }
Please login to merge, or discard this patch.
app/Devices.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@
 block discarded – undo
16 16
      */
17 17
     public $timestamps = false;
18 18
 
19
-    public function getIpAttribute( $ip )
19
+    public function getIpAttribute($ip)
20 20
     {
21
-        if (!empty($ip)){
22
-            return inet_ntop( $ip );
21
+        if (!empty($ip)) {
22
+            return inet_ntop($ip);
23 23
         }
24 24
     }
25 25
 
26
-    public function setIpAttribute( $ip )
26
+    public function setIpAttribute($ip)
27 27
     {
28
-        $this->attributes['ip'] = inet_pton( $ip );
28
+        $this->attributes['ip'] = inet_pton($ip);
29 29
     }
30 30
 
31 31
     // -- Define Reletionships --
Please login to merge, or discard this patch.