@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | // Delete an existing system - note this will fail if the system has any customers or tech tips assigned to it |
| 212 | - public function destroy($id) |
|
| 213 | - { |
|
| 214 | - // |
|
| 215 | - try { |
|
| 212 | + public function destroy($id) |
|
| 213 | + { |
|
| 214 | + // |
|
| 215 | + try { |
|
| 216 | 216 | SystemTypes::find($id)->delete(); |
| 217 | 217 | return response()->json(['success' => true, 'reason' => 'Equipment Successfully Deleted']); |
| 218 | 218 | } |
@@ -220,5 +220,5 @@ discard block |
||
| 220 | 220 | { |
| 221 | 221 | return response()->json(['success' => false, 'reason' => 'Cannot delete this equipment. It has Customers or Tech Tips assigned to it. Please delete those first.']); |
| 222 | 222 | } |
| 223 | - } |
|
| 223 | + } |
|
| 224 | 224 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | public function __construct() |
| 19 | 19 | { |
| 20 | 20 | $this->middleware('auth'); |
| 21 | - $this->middleware(function ($request, $next) { |
|
| 21 | + $this->middleware(function($request, $next) { |
|
| 22 | 22 | $this->authorize('hasAccess', 'Manage Equipment'); |
| 23 | 23 | return $next($request); |
| 24 | 24 | }); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $fields = SystemDataFieldTypes::all(); |
| 121 | 121 | $cat = SystemCategories::where('name', str_replace('-', ' ', $cat))->first(); |
| 122 | 122 | |
| 123 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
|
| 123 | + Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
|
| 124 | 124 | return view('installer.newSystem', [ |
| 125 | 125 | 'cat' => $cat, |
| 126 | 126 | 'dataList' => $fields, |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $query->join('system_data_field_types', 'system_data_fields.data_type_id', '=', 'system_data_field_types.data_type_id'); |
| 137 | 137 | }])->withCount('SystemDataFields')->first(); |
| 138 | 138 | |
| 139 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
|
| 139 | + Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
|
| 140 | 140 | return view('installer.editSystem', [ |
| 141 | 141 | 'system' => $system, |
| 142 | 142 | 'dataList' => $fields, |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | SystemTypes::find($id)->delete(); |
| 217 | 217 | return response()->json(['success' => true, 'reason' => 'Equipment Successfully Deleted']); |
| 218 | 218 | } |
| 219 | - catch (\Illuminate\Database\QueryException $e) |
|
| 219 | + catch(\Illuminate\Database\QueryException $e) |
|
| 220 | 220 | { |
| 221 | 221 | return response()->json(['success' => false, 'reason' => 'Cannot delete this equipment. It has Customers or Tech Tips assigned to it. Please delete those first.']); |
| 222 | 222 | } |
@@ -131,8 +131,7 @@ discard block |
||
| 131 | 131 | public function edit($id) |
| 132 | 132 | { |
| 133 | 133 | $fields = SystemDataFieldTypes::all(); |
| 134 | - $system = SystemTypes::where('sys_id', $id)->with(['SystemDataFields' => function($query) |
|
| 135 | - { |
|
| 134 | + $system = SystemTypes::where('sys_id', $id)->with(['SystemDataFields' => function($query) { |
|
| 136 | 135 | $query->join('system_data_field_types', 'system_data_fields.data_type_id', '=', 'system_data_field_types.data_type_id'); |
| 137 | 136 | }])->withCount('SystemDataFields')->first(); |
| 138 | 137 | |
@@ -212,7 +211,8 @@ discard block |
||
| 212 | 211 | public function destroy($id) |
| 213 | 212 | { |
| 214 | 213 | // |
| 215 | - try { |
|
| 214 | + try |
|
| 215 | + { |
|
| 216 | 216 | SystemTypes::find($id)->delete(); |
| 217 | 217 | return response()->json(['success' => true, 'reason' => 'Equipment Successfully Deleted']); |
| 218 | 218 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
| 74 | 74 | Log::notice('New Customer ID-'.$request->custID.' created by User ID-'.Auth::user()->user_id); |
| 75 | 75 | |
| 76 | - return response()->json(['success' => true, 'cust_id' => $custData->cust_id ]); |
|
| 76 | + return response()->json(['success' => true, 'cust_id' => $custData->cust_id]); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // Show the customer details |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $parentsParent = Customers::find($request->parent_id); |
| 144 | 144 | |
| 145 | - if ($parentsParent->parent_id) |
|
| 145 | + if($parentsParent->parent_id) |
|
| 146 | 146 | { |
| 147 | 147 | $request->parent_id = $parentsParent->parent_id; |
| 148 | 148 | } |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | private function updatePhoneIcons() |
| 67 | 67 | { |
| 68 | 68 | $newIcons = [ |
| 69 | - ['description' => 'Home', 'icon_class' => 'fas fa-home'], |
|
| 70 | - ['description' => 'Work', 'icon_class' => 'fas fa-briefcase'], |
|
| 69 | + ['description' => 'Home', 'icon_class' => 'fas fa-home'], |
|
| 70 | + ['description' => 'Work', 'icon_class' => 'fas fa-briefcase'], |
|
| 71 | 71 | ['description' => 'Mobile', 'icon_class' => 'fas fa-mobile-alt'], |
| 72 | 72 | ]; |
| 73 | 73 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | if(!Schema::hasColumn('users', 'role_id')) |
| 101 | 101 | { |
| 102 | - Schema::table('users', function (Blueprint $table) { |
|
| 102 | + Schema::table('users', function(Blueprint $table) { |
|
| 103 | 103 | $table->integer('role_id')->after('user_id')->unsigned()->default(4); |
| 104 | 104 | $table->foreign('role_id')->references('role_id')->on('user_role_descriptions')->onUpdate('cascade'); |
| 105 | 105 | }); |
@@ -326,8 +326,8 @@ discard block |
||
| 326 | 326 | // Add soft deletes to tech tips table to prevent accidental deletes |
| 327 | 327 | private function addSoftDeleteToTechTips() |
| 328 | 328 | { |
| 329 | - if (!Schema::hasColumn('tech_tips', 'deleted_at')) { |
|
| 330 | - Schema::table('tech_tips', function (Blueprint $table) { |
|
| 329 | + if(!Schema::hasColumn('tech_tips', 'deleted_at')) { |
|
| 330 | + Schema::table('tech_tips', function(Blueprint $table) { |
|
| 331 | 331 | $table->softDeletes()->after('description'); |
| 332 | 332 | }); |
| 333 | 333 | } |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | // Migrate over all deactivated users |
| 346 | 346 | DB::update('UPDATE `users` SET `deleted_at` = "'.Carbon::now().'" WHERE `active` = 0'); |
| 347 | 347 | // Remove the Active column |
| 348 | - Schema::table('users', function (Blueprint $table) { |
|
| 348 | + Schema::table('users', function(Blueprint $table) { |
|
| 349 | 349 | $table->dropColumn('active'); |
| 350 | 350 | }); |
| 351 | 351 | } |
@@ -364,27 +364,27 @@ discard block |
||
| 364 | 364 | } |
| 365 | 365 | if(!Schema::hasColumn('customer_systems', 'shared')) |
| 366 | 366 | { |
| 367 | - Schema::table('customer_systems', function (Blueprint $table) |
|
| 367 | + Schema::table('customer_systems', function(Blueprint $table) |
|
| 368 | 368 | { |
| 369 | 369 | $table->boolean('shared')->default(0)->after('sys_id'); |
| 370 | 370 | }); |
| 371 | 371 | } |
| 372 | - if (!Schema::hasColumn('customer_contacts', 'shared')) |
|
| 372 | + if(!Schema::hasColumn('customer_contacts', 'shared')) |
|
| 373 | 373 | { |
| 374 | - Schema::table('customer_contacts', function (Blueprint $table) |
|
| 374 | + Schema::table('customer_contacts', function(Blueprint $table) |
|
| 375 | 375 | { |
| 376 | 376 | $table->boolean('shared')->default(0)->after('cust_id'); |
| 377 | 377 | }); |
| 378 | 378 | } |
| 379 | - if (!Schema::hasColumn('customer_notes', 'shared')) |
|
| 379 | + if(!Schema::hasColumn('customer_notes', 'shared')) |
|
| 380 | 380 | { |
| 381 | - Schema::table('customer_notes', function (Blueprint $table) |
|
| 381 | + Schema::table('customer_notes', function(Blueprint $table) |
|
| 382 | 382 | { |
| 383 | 383 | $table->boolean('shared')->default(0)->after('user_id'); |
| 384 | 384 | }); |
| 385 | 385 | } |
| 386 | - if (!Schema::hasColumn('customer_files', 'shared')) { |
|
| 387 | - Schema::table('customer_files', function (Blueprint $table) { |
|
| 386 | + if(!Schema::hasColumn('customer_files', 'shared')) { |
|
| 387 | + Schema::table('customer_files', function(Blueprint $table) { |
|
| 388 | 388 | $table->boolean('shared')->default(0)->after('user_id'); |
| 389 | 389 | }); |
| 390 | 390 | } |
@@ -83,7 +83,8 @@ discard block |
||
| 83 | 83 | // Added the ability to set an expiration date for user passwords - will force them to change after this expires |
| 84 | 84 | private function addPasswordExpiresColumn() |
| 85 | 85 | { |
| 86 | - if(!Schema::hasColumn('users', 'password_expires')) { |
|
| 86 | + if(!Schema::hasColumn('users', 'password_expires')) |
|
| 87 | + { |
|
| 87 | 88 | Schema::table('users', function(Blueprint $table) { |
| 88 | 89 | $table->timestamp('password_expires') |
| 89 | 90 | ->nullable() |
@@ -119,7 +120,8 @@ discard block |
||
| 119 | 120 | // Added a 'hidden' attribute to system customer data types to allow passwords to not be viewed unless clicked or focus |
| 120 | 121 | private function addHiddenColumn() |
| 121 | 122 | { |
| 122 | - if(!Schema::hasColumn('system_data_field_types', 'hidden')) { |
|
| 123 | + if(!Schema::hasColumn('system_data_field_types', 'hidden')) |
|
| 124 | + { |
|
| 123 | 125 | Schema::table('system_cust_data_types', function(Blueprint $table) { |
| 124 | 126 | $table->boolean('hidden') |
| 125 | 127 | ->default(0) |
@@ -131,7 +133,8 @@ discard block |
||
| 131 | 133 | // Update the File links table - add cust_id and note column |
| 132 | 134 | private function addColumnsToFileLinksTable() |
| 133 | 135 | { |
| 134 | - if(!Schema::hasColumn('file_links', 'cust_id')) { |
|
| 136 | + if(!Schema::hasColumn('file_links', 'cust_id')) |
|
| 137 | + { |
|
| 135 | 138 | Schema::table('file_links', function(Blueprint $table) { |
| 136 | 139 | $table->integer('cust_id') |
| 137 | 140 | ->unsigned() |
@@ -140,7 +143,8 @@ discard block |
||
| 140 | 143 | $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade'); |
| 141 | 144 | }); |
| 142 | 145 | } |
| 143 | - if(!Schema::hasColumn('file_links', 'note')) { |
|
| 146 | + if(!Schema::hasColumn('file_links', 'note')) |
|
| 147 | + { |
|
| 144 | 148 | Schema::table('file_links', function(Blueprint $table) { |
| 145 | 149 | $table->longText('note') |
| 146 | 150 | ->nullable() |
@@ -148,7 +152,8 @@ discard block |
||
| 148 | 152 | }); |
| 149 | 153 | // Migrate the instructions from the old table to the new column |
| 150 | 154 | $instructions = DB::select('SELECT * FROM `file_link_instructions`'); |
| 151 | - foreach($instructions as $ins) { |
|
| 155 | + foreach($instructions as $ins) |
|
| 156 | + { |
|
| 152 | 157 | FileLinks::find($ins->link_id)->update([ |
| 153 | 158 | 'note' => $ins->instruction |
| 154 | 159 | ]); |
@@ -159,7 +164,8 @@ discard block |
||
| 159 | 164 | // Add Notes column to the file links files table |
| 160 | 165 | private function addNotesColumnToFileLinkFiles() |
| 161 | 166 | { |
| 162 | - if(!Schema::hasColumn('file_link_files', 'note')) { |
|
| 167 | + if(!Schema::hasColumn('file_link_files', 'note')) |
|
| 168 | + { |
|
| 163 | 169 | Schema::table('file_link_files', function(Blueprint $table) { |
| 164 | 170 | $table->longText('note') |
| 165 | 171 | ->nullable() |
@@ -167,7 +173,8 @@ discard block |
||
| 167 | 173 | }); |
| 168 | 174 | // Migrate the existing notes to the new table |
| 169 | 175 | $notes = DB::select('SELECT * FROM `file_link_notes`'); |
| 170 | - foreach($notes as $note) { |
|
| 176 | + foreach($notes as $note) |
|
| 177 | + { |
|
| 171 | 178 | FileLinkFiles::where('file_id', $note->file_id)->update([ |
| 172 | 179 | 'note' => $note->note |
| 173 | 180 | ]); |
@@ -178,7 +185,8 @@ discard block |
||
| 178 | 185 | // Add the documentation column to the tech tips table |
| 179 | 186 | private function migrateSystemDocumentation() |
| 180 | 187 | { |
| 181 | - if(!Schema::hasColumn('tech_tips', 'tip_type_id')) { |
|
| 188 | + if(!Schema::hasColumn('tech_tips', 'tip_type_id')) |
|
| 189 | + { |
|
| 182 | 190 | Schema::table('tech_tips', function(Blueprint $table) { |
| 183 | 191 | $table->bigInteger('tip_type_id')->unsigned()->after('public')->default(1); |
| 184 | 192 | $table->foreign('tip_type_id')->references('tip_type_id')->on('tech_tip_types')->onUpdate('cascade'); |
@@ -186,7 +194,8 @@ discard block |
||
| 186 | 194 | |
| 187 | 195 | // Move all of the system files over to the tech tips table |
| 188 | 196 | $sysFiles = DB::select('SELECT * FROM `system_files`'); |
| 189 | - foreach($sysFiles as $sysFile) { |
|
| 197 | + foreach($sysFiles as $sysFile) |
|
| 198 | + { |
|
| 190 | 199 | $newTip = TechTips::create([ |
| 191 | 200 | 'user_id' => $sysFile->user_id, |
| 192 | 201 | 'public' => 0, |
@@ -280,7 +289,8 @@ discard block |
||
| 280 | 289 | // Remove the system files and system file types table |
| 281 | 290 | private function removeSystemFilesTables() |
| 282 | 291 | { |
| 283 | - if(Schema::hasTable('system_files')) { |
|
| 292 | + if(Schema::hasTable('system_files')) |
|
| 293 | + { |
|
| 284 | 294 | Schema::table('system_files', function(Blueprint $table) { |
| 285 | 295 | $table->dropForeign(['sys_id']); |
| 286 | 296 | $table->dropForeign(['type_id']); |
@@ -326,7 +336,8 @@ discard block |
||
| 326 | 336 | // Add soft deletes to tech tips table to prevent accidental deletes |
| 327 | 337 | private function addSoftDeleteToTechTips() |
| 328 | 338 | { |
| 329 | - if (!Schema::hasColumn('tech_tips', 'deleted_at')) { |
|
| 339 | + if (!Schema::hasColumn('tech_tips', 'deleted_at')) |
|
| 340 | + { |
|
| 330 | 341 | Schema::table('tech_tips', function (Blueprint $table) { |
| 331 | 342 | $table->softDeletes()->after('description'); |
| 332 | 343 | }); |
@@ -338,8 +349,7 @@ discard block |
||
| 338 | 349 | { |
| 339 | 350 | if(!Schema::hasColumn('users', 'deleted_at')) |
| 340 | 351 | { |
| 341 | - Schema::table('users', function(Blueprint $table) |
|
| 342 | - { |
|
| 352 | + Schema::table('users', function(Blueprint $table) { |
|
| 343 | 353 | $table->softDeletes()->after('password_expires'); |
| 344 | 354 | }); |
| 345 | 355 | // Migrate over all deactivated users |
@@ -356,34 +366,31 @@ discard block |
||
| 356 | 366 | { |
| 357 | 367 | if(!Schema::hasColumn('customers', 'parent_id')) |
| 358 | 368 | { |
| 359 | - Schema::table('customers', function(Blueprint $table) |
|
| 360 | - { |
|
| 369 | + Schema::table('customers', function(Blueprint $table) { |
|
| 361 | 370 | $table->integer('parent_id')->after('cust_id')->nullable()->unsigned(); |
| 362 | 371 | $table->foreign('parent_id')->references('cust_id')->on('customers')->onUpdate('cascade'); |
| 363 | 372 | }); |
| 364 | 373 | } |
| 365 | 374 | if(!Schema::hasColumn('customer_systems', 'shared')) |
| 366 | 375 | { |
| 367 | - Schema::table('customer_systems', function (Blueprint $table) |
|
| 368 | - { |
|
| 376 | + Schema::table('customer_systems', function (Blueprint $table) { |
|
| 369 | 377 | $table->boolean('shared')->default(0)->after('sys_id'); |
| 370 | 378 | }); |
| 371 | 379 | } |
| 372 | 380 | if (!Schema::hasColumn('customer_contacts', 'shared')) |
| 373 | 381 | { |
| 374 | - Schema::table('customer_contacts', function (Blueprint $table) |
|
| 375 | - { |
|
| 382 | + Schema::table('customer_contacts', function (Blueprint $table) { |
|
| 376 | 383 | $table->boolean('shared')->default(0)->after('cust_id'); |
| 377 | 384 | }); |
| 378 | 385 | } |
| 379 | 386 | if (!Schema::hasColumn('customer_notes', 'shared')) |
| 380 | 387 | { |
| 381 | - Schema::table('customer_notes', function (Blueprint $table) |
|
| 382 | - { |
|
| 388 | + Schema::table('customer_notes', function (Blueprint $table) { |
|
| 383 | 389 | $table->boolean('shared')->default(0)->after('user_id'); |
| 384 | 390 | }); |
| 385 | 391 | } |
| 386 | - if (!Schema::hasColumn('customer_files', 'shared')) { |
|
| 392 | + if (!Schema::hasColumn('customer_files', 'shared')) |
|
| 393 | + { |
|
| 387 | 394 | Schema::table('customer_files', function (Blueprint $table) { |
| 388 | 395 | $table->boolean('shared')->default(0)->after('user_id'); |
| 389 | 396 | }); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ]; |
| 44 | 44 | } |
| 45 | 45 | $mods = Module::allDisabled(); |
| 46 | - foreach ($mods as $name => $mod) { |
|
| 46 | + foreach($mods as $name => $mod) { |
|
| 47 | 47 | $moduleList[] = [ |
| 48 | 48 | 'name' => $name, |
| 49 | 49 | 'status' => 'Disabled', |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request)); |
| 81 | 81 | |
| 82 | 82 | // Verify that the upload is valid and being processed |
| 83 | - if ($receiver->isUploaded() === false) { |
|
| 84 | - Log::error('Upload File Missing - ' . |
|
| 83 | + if($receiver->isUploaded() === false) { |
|
| 84 | + Log::error('Upload File Missing - '. |
|
| 85 | 85 | /** @scrutinizer ignore-type */ |
| 86 | 86 | $request->toArray()); |
| 87 | 87 | throw new UploadMissingFileException(); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $save = $receiver->receive(); |
| 92 | 92 | |
| 93 | 93 | // See if the uploade has finished |
| 94 | - if ($save->isFinished()) { |
|
| 94 | + if($save->isFinished()) { |
|
| 95 | 95 | $this->saveFile($save->getFile()); |
| 96 | 96 | |
| 97 | 97 | return 'uploaded successfully'; |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | // Get the current progress |
| 101 | 101 | $handler = $save->handler(); |
| 102 | 102 | |
| 103 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
|
| 104 | - Log::debug('File being uploaded. Percentage done - ' . $handler->getPercentageDone()); |
|
| 103 | + Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
|
| 104 | + Log::debug('File being uploaded. Percentage done - '.$handler->getPercentageDone()); |
|
| 105 | 105 | return response()->json([ |
| 106 | 106 | 'done' => $handler->getPercentageDone(), |
| 107 | 107 | 'status' => true |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | // Save a file attached to the link |
| 113 | 113 | private function saveFile(UploadedFile $file) |
| 114 | 114 | { |
| 115 | - $filePath = config('filesystems.disks.staging.root') . DIRECTORY_SEPARATOR . 'modules'.DIRECTORY_SEPARATOR; |
|
| 115 | + $filePath = config('filesystems.disks.staging.root').DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR; |
|
| 116 | 116 | |
| 117 | 117 | // Clean the file and store it |
| 118 | 118 | $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName()); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $module->extract(config('modules.paths.modules').DIRECTORY_SEPARATOR.$modName); |
| 136 | 136 | $module->close(); |
| 137 | 137 | |
| 138 | - Artisan::call('module:enable', ['module' => $modName]); |
|
| 138 | + Artisan::call('module:enable', ['module' => $modName]); |
|
| 139 | 139 | Artisan::call('module:migrate', ['module' => $modName]); |
| 140 | 140 | $this->delStaged($name); |
| 141 | 141 | |
@@ -43,7 +43,8 @@ discard block |
||
| 43 | 43 | ]; |
| 44 | 44 | } |
| 45 | 45 | $mods = Module::allDisabled(); |
| 46 | - foreach ($mods as $name => $mod) { |
|
| 46 | + foreach ($mods as $name => $mod) |
|
| 47 | + { |
|
| 47 | 48 | $moduleList[] = [ |
| 48 | 49 | 'name' => $name, |
| 49 | 50 | 'status' => 'Disabled', |
@@ -80,7 +81,8 @@ discard block |
||
| 80 | 81 | $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request)); |
| 81 | 82 | |
| 82 | 83 | // Verify that the upload is valid and being processed |
| 83 | - if ($receiver->isUploaded() === false) { |
|
| 84 | + if ($receiver->isUploaded() === false) |
|
| 85 | + { |
|
| 84 | 86 | Log::error('Upload File Missing - ' . |
| 85 | 87 | /** @scrutinizer ignore-type */ |
| 86 | 88 | $request->toArray()); |
@@ -91,7 +93,8 @@ discard block |
||
| 91 | 93 | $save = $receiver->receive(); |
| 92 | 94 | |
| 93 | 95 | // See if the uploade has finished |
| 94 | - if ($save->isFinished()) { |
|
| 96 | + if ($save->isFinished()) |
|
| 97 | + { |
|
| 95 | 98 | $this->saveFile($save->getFile()); |
| 96 | 99 | |
| 97 | 100 | return 'uploaded successfully'; |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | SystemDataFields::create([ |
| 58 | 58 | 'sys_id' => $sys->sys_id, |
| 59 | 59 | 'data_type_id' => $i, |
| 60 | - 'order' => $i-1, |
|
| 60 | + 'order' => $i - 1, |
|
| 61 | 61 | ]); |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | public function run() |
| 13 | 13 | { |
| 14 | 14 | // TODO: add seeders for demo setup |
| 15 | - $this->call(UserTableSeeder::class); |
|
| 16 | - $this->call(EquipmentSeeder::class); |
|
| 17 | - $this->call(CustomerSeeder::class); |
|
| 18 | - $this->call(TechTipsSeeder::class); |
|
| 15 | + $this->call(UserTableSeeder::class); |
|
| 16 | + $this->call(EquipmentSeeder::class); |
|
| 17 | + $this->call(CustomerSeeder::class); |
|
| 18 | + $this->call(TechTipsSeeder::class); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\Customers; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(Customers::class, function (Faker $faker) { |
|
| 8 | +$factory->define(Customers::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'cust_id' => $faker->unique()->numberBetween(50, 10000), |
| 11 | 11 | 'parent_id' => null, |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | 'first_name' => $faker->firstName, |
| 11 | 11 | 'last_name' => $faker->lastName, |
| 12 | 12 | 'email' => $faker->unique()->safeEmail, |
| 13 | - 'password' => bcrypt('password'), // All test users will have the password of 'password' to allow testing access |
|
| 13 | + 'password' => bcrypt('password'), // All test users will have the password of 'password' to allow testing access |
|
| 14 | 14 | 'remember_token' => Str::random(10), |
| 15 | 15 | 'password_expires' => null, |
| 16 | 16 | ]; |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | // Validate the hash token |
| 28 | 28 | $user = UserInitialize::where('token', $hash)->get(); |
| 29 | 29 | |
| 30 | - if ($user->isEmpty()) { |
|
| 31 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
|
| 32 | - Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to access invalid initialize hash - ' . $hash); |
|
| 30 | + if($user->isEmpty()) { |
|
| 31 | + Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
|
| 32 | + Log::warning('Visitor at IP Address '.\Request::ip().' tried to access invalid initialize hash - '.$hash); |
|
| 33 | 33 | return abort(404); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - Log::debug('Route ' . Route::currentRouteName() . ' visited.'); |
|
| 37 | - Log::debug('Link Hash -' . $hash); |
|
| 36 | + Log::debug('Route '.Route::currentRouteName().' visited.'); |
|
| 37 | + Log::debug('Link Hash -'.$hash); |
|
| 38 | 38 | return view('account.initializeUser', ['hash' => $hash]); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | // Verify that the link matches the assigned email address |
| 45 | 45 | $valid = UserInitialize::where('token', $hash)->first(); |
| 46 | - if (empty($valid)) { |
|
| 47 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
|
| 48 | - Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to submit an invalid User Initialization link - ' . $hash); |
|
| 46 | + if(empty($valid)) { |
|
| 47 | + Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
|
| 48 | + Log::warning('Visitor at IP Address '.\Request::ip().' tried to submit an invalid User Initialization link - '.$hash); |
|
| 49 | 49 | return abort(404); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | Auth::loginUsingID($userData->user_id); |
| 79 | 79 | |
| 80 | 80 | // Redirect the user to the dashboard |
| 81 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
|
| 81 | + Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
|
| 82 | 82 | Log::debug('Initialize Data - ', $request->toArray()); |
| 83 | 83 | Log::notice('User has setup account', ['user_id' => $userData->user_id]); |
| 84 | 84 | return redirect(route('dashboard')); |
@@ -135,7 +135,8 @@ discard block |
||
| 135 | 135 | // Validate the hash token |
| 136 | 136 | $user = UserInitialize::where('token', $hash)->get(); |
| 137 | 137 | |
| 138 | - if ($user->isEmpty()) { |
|
| 138 | + if ($user->isEmpty()) |
|
| 139 | + { |
|
| 139 | 140 | Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
| 140 | 141 | Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to access invalid initialize hash - ' . $hash); |
| 141 | 142 | return abort(404); |
@@ -151,7 +152,8 @@ discard block |
||
| 151 | 152 | { |
| 152 | 153 | // Verify that the link matches the assigned email address |
| 153 | 154 | $valid = UserInitialize::where('token', $hash)->first(); |
| 154 | - if (empty($valid)) { |
|
| 155 | + if (empty($valid)) |
|
| 156 | + { |
|
| 155 | 157 | Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
| 156 | 158 | Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to submit an invalid User Initialization link - ' . $hash); |
| 157 | 159 | return abort(404); |