@@ -41,7 +41,8 @@ discard block |
||
| 41 | 41 | ]; |
| 42 | 42 | } |
| 43 | 43 | $mods = Module::allDisabled(); |
| 44 | - foreach($mods as $name => $mod) { |
|
| 44 | + foreach($mods as $name => $mod) |
|
| 45 | + { |
|
| 45 | 46 | $moduleList[] = [ |
| 46 | 47 | 'name' => $name, |
| 47 | 48 | 'status' => 'Disabled', |
@@ -78,7 +79,8 @@ discard block |
||
| 78 | 79 | $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request)); |
| 79 | 80 | |
| 80 | 81 | // Verify that the upload is valid and being processed |
| 81 | - if($receiver->isUploaded() === false) { |
|
| 82 | + if($receiver->isUploaded() === false) |
|
| 83 | + { |
|
| 82 | 84 | Log::error('Upload File Missing - '. |
| 83 | 85 | /** @scrutinizer ignore-type */ |
| 84 | 86 | $request->toArray()); |
@@ -89,7 +91,8 @@ discard block |
||
| 89 | 91 | $save = $receiver->receive(); |
| 90 | 92 | |
| 91 | 93 | // See if the uploade has finished |
| 92 | - if($save->isFinished()) { |
|
| 94 | + if($save->isFinished()) |
|
| 95 | + { |
|
| 93 | 96 | $this->saveFile($save->getFile()); |
| 94 | 97 | |
| 95 | 98 | return 'uploaded successfully'; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ]); |
| 81 | 81 | |
| 82 | 82 | // Update the site timezone |
| 83 | - if (config('app.timezone') !== $request->timezone) |
|
| 83 | + if(config('app.timezone') !== $request->timezone) |
|
| 84 | 84 | { |
| 85 | 85 | Settings::firstOrCreate( |
| 86 | 86 | ['key' => 'app.timezone'], |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | )->update(['value' => $request->timezone]); |
| 89 | 89 | } |
| 90 | 90 | // Update the maximum file upload size |
| 91 | - if (config('filesystems.paths.max_size') !== $request->filesize) |
|
| 91 | + if(config('filesystems.paths.max_size') !== $request->filesize) |
|
| 92 | 92 | { |
| 93 | 93 | Settings::firstOrCreate( |
| 94 | 94 | ['key' => 'filesystems.paths.max_size'], |
@@ -211,7 +211,8 @@ |
||
| 211 | 211 | public function destroy($id) |
| 212 | 212 | { |
| 213 | 213 | // |
| 214 | - try { |
|
| 214 | + try |
|
| 215 | + { |
|
| 215 | 216 | SystemTypes::find($id)->delete(); |
| 216 | 217 | return response()->json(['success' => true, 'reason' => 'Equipment Successfully Deleted']); |
| 217 | 218 | } |
@@ -59,9 +59,12 @@ discard block |
||
| 59 | 59 | public function archiveFiles(Request $request) |
| 60 | 60 | { |
| 61 | 61 | // Debug Data |
| 62 | - if(Auth::user()) { |
|
| 62 | + if(Auth::user()) |
|
| 63 | + { |
|
| 63 | 64 | $user = Auth::user()->full_name; |
| 64 | - } else { |
|
| 65 | + } |
|
| 66 | + else |
|
| 67 | + { |
|
| 65 | 68 | $user = \Request::ip(); |
| 66 | 69 | } |
| 67 | 70 | Log::debug('Route '.Route::currentRouteName().' visited by '.$user.' Request Data:', $request->toArray()); |
@@ -107,9 +110,12 @@ discard block |
||
| 107 | 110 | public function downloadArchive($fileName) |
| 108 | 111 | { |
| 109 | 112 | // Debug Data |
| 110 | - if(Auth::user()) { |
|
| 113 | + if(Auth::user()) |
|
| 114 | + { |
|
| 111 | 115 | $user = Auth::user()->full_name; |
| 112 | - } else { |
|
| 116 | + } |
|
| 117 | + else |
|
| 118 | + { |
|
| 113 | 119 | $user = \Request::ip(); |
| 114 | 120 | } |
| 115 | 121 | Log::debug('Route '.Route::currentRouteName().' visited by '.$user); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | Log::debug('Preparing to clean a file. Current Name - '.$fileName.'. Current Path - '.$path); |
| 20 | 20 | // Remove all spaces |
| 21 | 21 | $fileName = str_replace(' ', '_', $fileName); |
| 22 | - Log::debug('Cleaned Filename. Current Name - ' . $fileName . '. Current Path - ' . $path); |
|
| 22 | + Log::debug('Cleaned Filename. Current Name - '.$fileName.'. Current Path - '.$path); |
|
| 23 | 23 | |
| 24 | 24 | // Determine if the filename already exists |
| 25 | 25 | if(Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)) |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | // Increase the number until one that is not in use is found |
| 45 | 45 | do |
| 46 | 46 | { |
| 47 | - Log::debug('Filename ' . $fileName . ' already exists. Appending name.'); |
|
| 47 | + Log::debug('Filename '.$fileName.' already exists. Appending name.'); |
|
| 48 | 48 | $fileName = $base.'('.++$number.')'.$extension; |
| 49 | 49 | } while(Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)); |
| 50 | 50 | } |
@@ -22,16 +22,16 @@ discard block |
||
| 22 | 22 | // Dashboard is the Logged In User home landing page |
| 23 | 23 | public function index() |
| 24 | 24 | { |
| 25 | - Log::debug('Route "' . Route::currentRouteName() . '" visited by ' . Auth::user()->full_name); |
|
| 25 | + Log::debug('Route "'.Route::currentRouteName().'" visited by '.Auth::user()->full_name); |
|
| 26 | 26 | |
| 27 | 27 | // Get Dashboard data |
| 28 | - $custFavs = CustomerFavs::where('user_id', Auth::user()->user_id) |
|
| 29 | - ->with(array('Customers' => function($query){ |
|
| 28 | + $custFavs = CustomerFavs::where('user_id', Auth::user()->user_id) |
|
| 29 | + ->with(array('Customers' => function($query) { |
|
| 30 | 30 | $query->select('cust_id', 'name'); |
| 31 | 31 | })) |
| 32 | 32 | ->get(); |
| 33 | - $tipFavs = TechTipFavs::where('user_id', Auth::user()->user_id) |
|
| 34 | - ->with(array('TechTips' => function($query){ |
|
| 33 | + $tipFavs = TechTipFavs::where('user_id', Auth::user()->user_id) |
|
| 34 | + ->with(array('TechTips' => function($query) { |
|
| 35 | 35 | $query->select('tip_id', 'subject'); |
| 36 | 36 | })) |
| 37 | 37 | ->get(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | // Mark a notification as read |
| 68 | 68 | public function markNotification($id) |
| 69 | 69 | { |
| 70 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 70 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 71 | 71 | |
| 72 | 72 | $notification = Auth::user()->notifications()->where('id', $id)->where('notifiable_id', Auth::user()->user_id)->first(); |
| 73 | 73 | if(!$notification) |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | // Delte a user notification |
| 86 | 86 | public function delNotification($id) |
| 87 | 87 | { |
| 88 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 88 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 89 | 89 | |
| 90 | 90 | $notification = Auth::user()->notifications()->where('id', $id)->where('notifiable_id', Auth::user()->user_id)->first(); |
| 91 | 91 | if(!$notification) |
| 92 | 92 | { |
| 93 | - Log::error('User ' . Auth::user()->full_name . ' tried to delete an invalid notification. Notification ID: ' . $id); |
|
| 93 | + Log::error('User '.Auth::user()->full_name.' tried to delete an invalid notification. Notification ID: '.$id); |
|
| 94 | 94 | return abort(404); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -26,12 +26,12 @@ |
||
| 26 | 26 | |
| 27 | 27 | // Get Dashboard data |
| 28 | 28 | $custFavs = CustomerFavs::where('user_id', Auth::user()->user_id) |
| 29 | - ->with(array('Customers' => function($query){ |
|
| 29 | + ->with(array('Customers' => function($query) { |
|
| 30 | 30 | $query->select('cust_id', 'name'); |
| 31 | 31 | })) |
| 32 | 32 | ->get(); |
| 33 | 33 | $tipFavs = TechTipFavs::where('user_id', Auth::user()->user_id) |
| 34 | - ->with(array('TechTips' => function($query){ |
|
| 34 | + ->with(array('TechTips' => function($query) { |
|
| 35 | 35 | $query->select('tip_id', 'subject'); |
| 36 | 36 | })) |
| 37 | 37 | ->get(); |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | // Retrieve the instructions attached to a link |
| 260 | 260 | public function getInstructions($linkID) |
| 261 | 261 | { |
| 262 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 262 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 263 | 263 | |
| 264 | 264 | $linkData = FileLinks::select('note')->where('link_id', $linkID)->first(); |
| 265 | 265 | Log::debug('Link Instructions Gathered - ', array($linkData)); |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | // Update the instructions attached to the link |
| 271 | 271 | public function submitInstructions(Request $request, $linkID) |
| 272 | 272 | { |
| 273 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name . '. Submitted Data - ', $request->toArray()); |
|
| 273 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
| 274 | 274 | |
| 275 | 275 | FileLinks::find($linkID)->update([ |
| 276 | 276 | 'note' => $request->instructions, |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | // Show the files attached to a link |
| 90 | 90 | public function show($id) |
| 91 | 91 | { |
| 92 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 92 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 93 | 93 | |
| 94 | 94 | $files = new FileLinkFilesCollection( |
| 95 | 95 | FileLinkFiles::where('link_id', $id) |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | // Delete a file attached to a link |
| 161 | 161 | public function destroy($id) |
| 162 | 162 | { |
| 163 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 163 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 164 | 164 | Log::debug('Submitted File ID to be deleted - '.$id); |
| 165 | 165 | |
| 166 | 166 | // Get the necessary file information and delete it from the database |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | // Show the link details for the user |
| 30 | 30 | public function show($id) |
| 31 | 31 | { |
| 32 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by IP Address ' . \Request::ip()); |
|
| 32 | + Log::debug('Route '.Route::currentRouteName().' visited by IP Address '.\Request::ip()); |
|
| 33 | 33 | |
| 34 | 34 | $details = FileLinks::where('link_hash', $id)->first(); |
| 35 | 35 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | // Notify the owner of the link that files were uploaded |
| 147 | 147 | public function notify(Request $request, $id) |
| 148 | 148 | { |
| 149 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by IP Address ' . \Request::ip() . '. Submitted Data - ', $request->toArray()); |
|
| 149 | + Log::debug('Route '.Route::currentRouteName().' visited by IP Address '.\Request::ip().'. Submitted Data - ', $request->toArray()); |
|
| 150 | 150 | |
| 151 | 151 | $request->validate([ |
| 152 | 152 | '_complete' => 'required', |