@@ -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,9 +2,7 @@ |
||
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 | -use Illuminate\Support\Facades\Cache; |
|
8 | 6 | use Illuminate\Support\Facades\Storage; |
9 | 7 | |
10 | 8 | class ImageController extends Controller |
@@ -7,8 +7,6 @@ |
||
7 | 7 | use App\Device; |
8 | 8 | use App\Deviceimage; |
9 | 9 | use App\User; |
10 | -use Illuminate\Support\Facades\Cache; |
|
11 | -use Illuminate\Support\Facades\Storage; |
|
12 | 10 | |
13 | 11 | class ApiController extends Controller |
14 | 12 | { |
@@ -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 DeviceRegister extends Notification |
@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | -use Illuminate\Support\Facades\DB; |
|
7 | 5 | use App\Device; |
8 | 6 | use App\Site; |
9 | 7 | use App\Location; |
@@ -80,8 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | $sites = $this->site_m->orderedSitesBy($location->site_id); |
82 | 82 | $locations = $this->location_m->orderedSiteLocationsBy($location->site_id, $device->location_id); |
83 | - } |
|
84 | - else |
|
83 | + } else |
|
85 | 84 | { |
86 | 85 | $locations = null; |
87 | 86 | $sites = $this->site_m->all(); |
@@ -178,10 +177,11 @@ discard block |
||
178 | 177 | ]); |
179 | 178 | |
180 | 179 | if ($validator->fails()) { |
181 | - if ($request->input('from') == 'modal') |
|
182 | - return response()->json(['errors'=>$validator->errors()], 422); |
|
183 | - else |
|
184 | - return redirect('device/'.$id.'/edit')->withErrors($validator)->withInput(); |
|
180 | + if ($request->input('from') == 'modal') { |
|
181 | + return response()->json(['errors'=>$validator->errors()], 422); |
|
182 | + } else { |
|
183 | + return redirect('device/'.$id.'/edit')->withErrors($validator)->withInput(); |
|
184 | + } |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | $siteNew = !empty($request->input('new_site_name')); |
@@ -191,8 +191,7 @@ discard block |
||
191 | 191 | //Create a new site |
192 | 192 | $siteName = $request->input('new_site_name'); |
193 | 193 | $site_id = $this->site_m->createSite($siteName); |
194 | - } |
|
195 | - else |
|
194 | + } else |
|
196 | 195 | { |
197 | 196 | $site_id = $request->input('site'); |
198 | 197 | } |
@@ -204,8 +203,7 @@ discard block |
||
204 | 203 | //Create a new location |
205 | 204 | $locationName = $request->input('new_location_name'); |
206 | 205 | $location_id = $this->location_m->createLocation($locationName, $site_id); |
207 | - } |
|
208 | - else |
|
206 | + } else |
|
209 | 207 | { |
210 | 208 | $location_id = $request->input('location'); |
211 | 209 | } |
@@ -220,10 +218,11 @@ discard block |
||
220 | 218 | //If the old site isn't connected to a device then remove it |
221 | 219 | $this->removeUnusedSite($oldLocationID); |
222 | 220 | |
223 | - if ($request->input('from') == 'modal') |
|
224 | - return "Success"; |
|
225 | - else |
|
226 | - return redirect('device'); |
|
221 | + if ($request->input('from') == 'modal') { |
|
222 | + return "Success"; |
|
223 | + } else { |
|
224 | + return redirect('device'); |
|
225 | + } |
|
227 | 226 | } |
228 | 227 | |
229 | 228 | /** |
@@ -240,8 +239,7 @@ discard block |
||
240 | 239 | { |
241 | 240 | //If the user was already deleted then permanently delete it |
242 | 241 | $this->device_m->destroy($id); |
243 | - } |
|
244 | - else |
|
242 | + } else |
|
245 | 243 | { |
246 | 244 | //Remove the location from the device |
247 | 245 | $oldLocation_id = $device->location_id; |
@@ -287,8 +285,7 @@ discard block |
||
287 | 285 | { |
288 | 286 | //Get the site connected to the location and delete it |
289 | 287 | $this->site_m->findOrFail($site_id)->delete(); |
290 | - } |
|
291 | - else |
|
288 | + } else |
|
292 | 289 | { |
293 | 290 | //Delete the location that isn't used anymore |
294 | 291 | $oldLocation->delete(); |