Completed
Push — master ( efae37...460051 )
by Brandon
19s
created
app/Http/Controllers/DashboardController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Http\Controllers;
4 4
 
5
-use Illuminate\Http\Request;
6
-
7 5
 class DashboardController extends Controller
8 6
 {
9 7
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/HomeController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Http\Controllers;
4 4
 
5
-use Illuminate\Http\Request;
6
-
7 5
 class HomeController extends Controller
8 6
 {
9 7
     /**
Please login to merge, or discard this patch.
app/Notifications/InvoicePaid.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Bus\Queueable;
6 6
 use Illuminate\Notifications\Notification;
7
-use Illuminate\Contracts\Queue\ShouldQueue;
8 7
 use Illuminate\Notifications\Messages\NexmoMessage;
9 8
 
10 9
 class InvoicePaid extends Notification
Please login to merge, or discard this patch.
app/Http/Controllers/ImageController.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Http\Controllers;
4 4
 
5
-use Illuminate\Http\Request;
6 5
 use Intervention\Image\Facades\Image as Image;
7 6
 
8 7
 class ImageController extends Controller
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
     public function show($device_id)
27 27
     {
28 28
         $storagePath = storage_path('app/images/devices/');
29
-        $imagePath = glob($storagePath . $device_id . "*" . ".jpg");
29
+        $imagePath = glob($storagePath.$device_id."*".".jpg");
30 30
         
31 31
         if (!empty($imagePath))
32
-            $image = Image::make($imagePath[0]);
32
+            $image = Image::make($imagePath[ 0 ]);
33 33
         else
34 34
         {
35
-            $imagePath = public_path() . '/img/video_not_found.jpg';
35
+            $imagePath = public_path().'/img/video_not_found.jpg';
36 36
             $image = Image::make($imagePath);
37 37
         }
38 38
         
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function store($device_id, $binaryData)
50 50
     {
51
-        $storagePath = storage_path('app/images/devices/') . $device_id . '.jpg';
51
+        $storagePath = storage_path('app/images/devices/').$device_id.'.jpg';
52 52
         $image = Image::make($binaryData);
53 53
         $image->save($storagePath, 75);
54 54
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@
 block discarded – undo
28 28
         $storagePath = storage_path('app/images/devices/');
29 29
         $imagePath = glob($storagePath . $device_id . "*" . ".jpg");
30 30
         
31
-        if (!empty($imagePath))
32
-            $image = Image::make($imagePath[0]);
33
-        else
31
+        if (!empty($imagePath)) {
32
+                    $image = Image::make($imagePath[0]);
33
+        } else
34 34
         {
35 35
             $imagePath = public_path() . '/img/video_not_found.jpg';
36 36
             $image = Image::make($imagePath);
Please login to merge, or discard this patch.
app/Device.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Database\Eloquent\Model;
6 6
 use Illuminate\Database\Eloquent\SoftDeletes;
7
-use Illuminate\Support\Facades\DB;
8 7
 
9 8
 class Device extends Model
10 9
 {
Please login to merge, or discard this patch.
app/Location.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@
 block discarded – undo
55 55
      */
56 56
     public function orderedSiteLocationsBy($site_id, $location_id)
57 57
     {
58
-        $locations = self::query()->select(['id', 'name'])
58
+        $locations = self::query()->select([ 'id', 'name' ])
59 59
                                     ->where('site_id', '=', $site_id)
60
-                                    ->orderByRaw(DB::raw("(id = " . $location_id . ") DESC"))
60
+                                    ->orderByRaw(DB::raw("(id = ".$location_id.") DESC"))
61 61
                                     ->get();
62 62
         return $locations;
63 63
     }
Please login to merge, or discard this patch.
app/Http/Controllers/DeviceController.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@  discard block
 block discarded – undo
79 79
         {
80 80
             $sites = $this->site_m->orderedSitesBy($location->site_id);
81 81
             $locations = $this->location_m->orderedSiteLocationsBy($location->site_id, $device->location_id);
82
-        }
83
-        else
82
+        } else
84 83
         {
85 84
             $locations = null;
86 85
             $sites = $this->site_m->all();
@@ -141,8 +140,7 @@  discard block
 block discarded – undo
141 140
             //Create a new site
142 141
             $siteName = $request->input('new_site_name');
143 142
             $site_id = $this->site_m->createSite($siteName);
144
-        }
145
-        else
143
+        } else
146 144
         {
147 145
             $site_id = $request->input('site');
148 146
         }
@@ -154,8 +152,7 @@  discard block
 block discarded – undo
154 152
             //Create a new location
155 153
             $locationName = $request->input('new_location_name');
156 154
             $location_id = $this->location_m->createLocation($locationName, $site_id);
157
-        }
158
-        else
155
+        } else
159 156
         {
160 157
             $location_id = $request->input('location');
161 158
         }
@@ -185,8 +182,7 @@  discard block
 block discarded – undo
185 182
         {
186 183
             //If the user was already deleted then permanently delete it
187 184
             $this->device_m->destroy($id);
188
-        }
189
-        else
185
+        } else
190 186
         {
191 187
             //Remove the location from the device
192 188
             $oldLocation_id = $device->location_id;
@@ -232,8 +228,7 @@  discard block
 block discarded – undo
232 228
             {
233 229
                 //Get the site connected to the location and delete it
234 230
                 $this->site_m->findOrFail($site_id)->delete();
235
-            }
236
-            else
231
+            } else
237 232
             {
238 233
                 //Delete the location that isn't used anymore
239 234
                 $oldLocation->delete();
Please login to merge, or discard this patch.
app/Site.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
      */
43 43
     public function orderedSitesBy($id)
44 44
     {
45
-        $sites = self::query()->select(['id', 'name'])
46
-                                ->orderByRaw(DB::raw("(id = " . $id . ") DESC"))
45
+        $sites = self::query()->select([ 'id', 'name' ])
46
+                                ->orderByRaw(DB::raw("(id = ".$id.") DESC"))
47 47
                                 ->get();
48 48
         return $sites;
49 49
     }
Please login to merge, or discard this patch.