@@ -2,8 +2,6 @@ |
||
| 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 | /** |
@@ -2,8 +2,6 @@ |
||
| 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 | /** |
@@ -4,7 +4,6 @@ |
||
| 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 |
@@ -2,7 +2,6 @@ |
||
| 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 |
@@ -26,13 +26,13 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -28,9 +28,9 @@ |
||
| 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); |
@@ -76,14 +76,14 @@ |
||
| 76 | 76 | 'id', |
| 77 | 77 | 'name', |
| 78 | 78 | ]) |
| 79 | - ->orderByRaw(DB::raw("(id = " . $location->site_id . ") DESC")) |
|
| 79 | + ->orderByRaw(DB::raw("(id = ".$location->site_id.") DESC")) |
|
| 80 | 80 | ->get(); |
| 81 | 81 | $locations = Location::query()->select([ |
| 82 | 82 | 'id', |
| 83 | 83 | 'name', |
| 84 | 84 | ]) |
| 85 | 85 | ->where('site_id', '=', $location->site_id) |
| 86 | - ->orderByRaw(DB::raw("(id = " . $device->location_id . ") DESC")) |
|
| 86 | + ->orderByRaw(DB::raw("(id = ".$device->location_id.") DESC")) |
|
| 87 | 87 | ->get(); |
| 88 | 88 | } |
| 89 | 89 | else |
@@ -85,8 +85,7 @@ discard block |
||
| 85 | 85 | ->where('site_id', '=', $location->site_id) |
| 86 | 86 | ->orderByRaw(DB::raw("(id = " . $device->location_id . ") DESC")) |
| 87 | 87 | ->get(); |
| 88 | - } |
|
| 89 | - else |
|
| 88 | + } else |
|
| 90 | 89 | { |
| 91 | 90 | $locations = null; |
| 92 | 91 | $sites = Site::all(); |
@@ -150,8 +149,7 @@ discard block |
||
| 150 | 149 | $site->name = $siteName; |
| 151 | 150 | $site->save(); |
| 152 | 151 | $site_id = $site->id; |
| 153 | - } |
|
| 154 | - else |
|
| 152 | + } else |
|
| 155 | 153 | { |
| 156 | 154 | $site_id = $request->input('site'); |
| 157 | 155 | } |
@@ -167,8 +165,7 @@ discard block |
||
| 167 | 165 | $location->site_id = $site_id; |
| 168 | 166 | $location->save(); |
| 169 | 167 | $location_id = $location->id; |
| 170 | - } |
|
| 171 | - else |
|
| 168 | + } else |
|
| 172 | 169 | { |
| 173 | 170 | $location_id = $request->input('location'); |
| 174 | 171 | } |
@@ -248,8 +245,7 @@ discard block |
||
| 248 | 245 | { |
| 249 | 246 | //Get the site connected to the location and delete it |
| 250 | 247 | Site::where('id', '=', $site_id)->delete(); |
| 251 | - } |
|
| 252 | - else |
|
| 248 | + } else |
|
| 253 | 249 | { |
| 254 | 250 | //Delete the location that isn't used anymore |
| 255 | 251 | Location::where('id', '=', $oldLocationID)->delete(); |