@@ -65,7 +65,7 @@ |
||
| 65 | 65 | Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
| 66 | 66 | Log::notice('New Customer ID-'.$request->custID.' created by User ID-'.Auth::user()->user_id); |
| 67 | 67 | |
| 68 | - return response()->json(['success' => true ]); |
|
| 68 | + return response()->json(['success' => true]); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // Show the customer details |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\SystemCategories; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(SystemCategories::class, function (Faker $faker) { |
|
| 8 | +$factory->define(SystemCategories::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | // |
| 11 | 11 | 'name' => $faker->unique()->text(15) |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\SystemDataFieldTypes; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(SystemDataFieldTypes::class, function (Faker $faker) { |
|
| 8 | +$factory->define(SystemDataFieldTypes::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | // |
| 11 | 11 | 'name' => $faker->words(), |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\CustomerSystemData; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(CustomerSystemData::class, function (Faker $faker) { |
|
| 8 | +$factory->define(CustomerSystemData::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | // |
| 11 | 11 | 'cust_sys_id' => factory(App\CustomerSystems::class)->create()->cust_sys_id, |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | |
| 109 | 109 | foreach($fields as $data) |
| 110 | 110 | { |
| 111 | - $fieldName = 'field_' . $data->field_id; |
|
| 111 | + $fieldName = 'field_'.$data->field_id; |
|
| 112 | 112 | if(isset($request->$fieldName)) |
| 113 | 113 | { |
| 114 | 114 | Log::debug($request->$fieldName); |
@@ -8,58 +8,58 @@ |
||
| 8 | 8 | /* |
| 9 | 9 | * Non user Routes |
| 10 | 10 | */ |
| 11 | -Route::get('/', 'Auth\LoginController@showLoginForm')->name('index'); |
|
| 12 | -Route::get('logout', 'Auth\LoginController@logout') ->name('logout'); |
|
| 11 | +Route::get('/', 'Auth\LoginController@showLoginForm')->name('index'); |
|
| 12 | +Route::get('logout', 'Auth\LoginController@logout') ->name('logout'); |
|
| 13 | 13 | Route::get('no-script', 'Controller@noScript') ->name('noscript'); |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | /* |
| 17 | 17 | * Download File Routes |
| 18 | 18 | */ |
| 19 | -Route::get('download/{id}/{filename}', 'DownloadController@index') ->name('download'); |
|
| 19 | +Route::get('download/{id}/{filename}', 'DownloadController@index') ->name('download'); |
|
| 20 | 20 | Route::get('download-archive/{filename}', 'DownloadController@downloadArchive')->name('downloadArchive'); |
| 21 | -Route::put('download-archive', 'DownloadController@archiveFiles') ->name('archiveFiles'); |
|
| 21 | +Route::put('download-archive', 'DownloadController@archiveFiles') ->name('archiveFiles'); |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /* |
| 25 | 25 | * User Settings Routes |
| 26 | 26 | */ |
| 27 | -Route::get('account', 'AccountController@index') ->name('account'); |
|
| 28 | -Route::post('account', 'AccountController@submit') ->name('account'); |
|
| 29 | -Route::put('account', 'AccountController@notifications') ->name('account'); |
|
| 30 | -Route::get('/account/change-password', 'AccountController@changePassword')->name('changePassword'); |
|
| 27 | +Route::get('account', 'AccountController@index') ->name('account'); |
|
| 28 | +Route::post('account', 'AccountController@submit') ->name('account'); |
|
| 29 | +Route::put('account', 'AccountController@notifications') ->name('account'); |
|
| 30 | +Route::get('/account/change-password', 'AccountController@changePassword')->name('changePassword'); |
|
| 31 | 31 | Route::post('/account/change-password', 'AccountController@submitPassword')->name('changePassword'); |
| 32 | 32 | |
| 33 | 33 | /* |
| 34 | 34 | * Basic Logged In Routes |
| 35 | 35 | */ |
| 36 | -Route::get('about', 'DashboardController@about')->name('about'); |
|
| 36 | +Route::get('about', 'DashboardController@about')->name('about'); |
|
| 37 | 37 | Route::get('dashboard', 'DashboardController@index')->name('dashboard'); |
| 38 | 38 | |
| 39 | 39 | /* |
| 40 | 40 | * File Link Routes |
| 41 | 41 | */ |
| 42 | -Route::prefix('links')->name('links.')->group(function () { |
|
| 42 | +Route::prefix('links')->name('links.')->group(function() { |
|
| 43 | 43 | // Resource controllers for base access |
| 44 | - Route::resource('data', 'FileLinks\FileLinksController'); |
|
| 45 | - Route::get('new', 'FileLinks\FileLinksController@create') ->name('new'); |
|
| 46 | - Route::get('find/{id}', 'FileLinks\FileLinksController@find') ->name('user'); |
|
| 44 | + Route::resource('data', 'FileLinks\FileLinksController'); |
|
| 45 | + Route::get('new', 'FileLinks\FileLinksController@create') ->name('new'); |
|
| 46 | + Route::get('find/{id}', 'FileLinks\FileLinksController@find') ->name('user'); |
|
| 47 | 47 | Route::get('details/{id}/{name}', 'FileLinks\FileLinksController@details') ->name('details'); |
| 48 | - Route::get('disable/{id}', 'FileLinks\FileLinksController@disableLink')->name('disable'); |
|
| 48 | + Route::get('disable/{id}', 'FileLinks\FileLinksController@disableLink')->name('disable'); |
|
| 49 | 49 | // File Link Files |
| 50 | - Route::resource('files', 'FileLinks\LinkFilesController'); |
|
| 50 | + Route::resource('files', 'FileLinks\LinkFilesController'); |
|
| 51 | 51 | // Index landing page |
| 52 | - Route::get('/', 'FileLinks\FileLinksController@index') ->name('index'); |
|
| 52 | + Route::get('/', 'FileLinks\FileLinksController@index') ->name('index'); |
|
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | 55 | /* |
| 56 | 56 | * Guest File Link Routes |
| 57 | 57 | */ |
| 58 | 58 | Route::get('file-links/{id}/get-files', 'FileLinks\GuestLinksController@getFiles')->name('file-links.getFiles'); |
| 59 | -Route::put('file-links/{id}', 'FileLinks\GuestLinksController@notify') ->name('file-links.show'); |
|
| 60 | -Route::post('file-links/{id}', 'FileLinks\GuestLinksController@update') ->name('file-links.show'); |
|
| 61 | -Route::get('file-links/{id}', 'FileLinks\GuestLinksController@show') ->name('file-links.show'); |
|
| 62 | -Route::get('file-links', 'FileLinks\GuestLinksController@index') ->name('file-links.index'); |
|
| 59 | +Route::put('file-links/{id}', 'FileLinks\GuestLinksController@notify') ->name('file-links.show'); |
|
| 60 | +Route::post('file-links/{id}', 'FileLinks\GuestLinksController@update') ->name('file-links.show'); |
|
| 61 | +Route::get('file-links/{id}', 'FileLinks\GuestLinksController@show') ->name('file-links.show'); |
|
| 62 | +Route::get('file-links', 'FileLinks\GuestLinksController@index') ->name('file-links.index'); |
|
| 63 | 63 | |
| 64 | 64 | /* |
| 65 | 65 | * Customer Routes |
@@ -80,7 +80,8 @@ discard block |
||
| 80 | 80 | // Added the ability to set an expiration date for user passwords - will force them to change after this expires |
| 81 | 81 | private function addPasswordExpiresColumn() |
| 82 | 82 | { |
| 83 | - if(!Schema::hasColumn('users', 'password_expires')) { |
|
| 83 | + if(!Schema::hasColumn('users', 'password_expires')) |
|
| 84 | + { |
|
| 84 | 85 | Schema::table('users', function(Blueprint $table) { |
| 85 | 86 | $table->timestamp('password_expires') |
| 86 | 87 | ->nullable() |
@@ -150,7 +151,8 @@ discard block |
||
| 150 | 151 | // Added a 'hidden' attribute to system customer data types to allow passwords to not be viewed unless clicked or focus |
| 151 | 152 | private function addHiddenColumn() |
| 152 | 153 | { |
| 153 | - if(!Schema::hasColumn('system_data_field_types', 'hidden')) { |
|
| 154 | + if(!Schema::hasColumn('system_data_field_types', 'hidden')) |
|
| 155 | + { |
|
| 154 | 156 | Schema::table('system_cust_data_types', function(Blueprint $table) { |
| 155 | 157 | $table->boolean('hidden') |
| 156 | 158 | ->default(0) |
@@ -162,7 +164,8 @@ discard block |
||
| 162 | 164 | // Update the File links table - add cust_id and note column |
| 163 | 165 | private function addColumnsToFileLinksTable() |
| 164 | 166 | { |
| 165 | - if(!Schema::hasColumn('file_links', 'cust_id')) { |
|
| 167 | + if(!Schema::hasColumn('file_links', 'cust_id')) |
|
| 168 | + { |
|
| 166 | 169 | Schema::table('file_links', function(Blueprint $table) { |
| 167 | 170 | $table->integer('cust_id') |
| 168 | 171 | ->unsigned() |
@@ -171,7 +174,8 @@ discard block |
||
| 171 | 174 | $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade'); |
| 172 | 175 | }); |
| 173 | 176 | } |
| 174 | - if(!Schema::hasColumn('file_links', 'note')) { |
|
| 177 | + if(!Schema::hasColumn('file_links', 'note')) |
|
| 178 | + { |
|
| 175 | 179 | Schema::table('file_links', function(Blueprint $table) { |
| 176 | 180 | $table->longText('note') |
| 177 | 181 | ->nullable() |
@@ -179,7 +183,8 @@ discard block |
||
| 179 | 183 | }); |
| 180 | 184 | // Migrate the instructions from the old table to the new column |
| 181 | 185 | $instructions = DB::select('SELECT * FROM `file_link_instructions`'); |
| 182 | - foreach($instructions as $ins) { |
|
| 186 | + foreach($instructions as $ins) |
|
| 187 | + { |
|
| 183 | 188 | FileLinks::find($ins->link_id)->update([ |
| 184 | 189 | 'note' => $ins->instruction |
| 185 | 190 | ]); |
@@ -190,7 +195,8 @@ discard block |
||
| 190 | 195 | // Add Notes column to the file links files table |
| 191 | 196 | private function addNotesColumnToFileLinkFiles() |
| 192 | 197 | { |
| 193 | - if(!Schema::hasColumn('file_link_files', 'note')) { |
|
| 198 | + if(!Schema::hasColumn('file_link_files', 'note')) |
|
| 199 | + { |
|
| 194 | 200 | Schema::table('file_link_files', function(Blueprint $table) { |
| 195 | 201 | $table->longText('note') |
| 196 | 202 | ->nullable() |
@@ -198,7 +204,8 @@ discard block |
||
| 198 | 204 | }); |
| 199 | 205 | // Migrate the existing notes to the new table |
| 200 | 206 | $notes = DB::select('SELECT * FROM `file_link_notes`'); |
| 201 | - foreach($notes as $note) { |
|
| 207 | + foreach($notes as $note) |
|
| 208 | + { |
|
| 202 | 209 | FileLinkFiles::where('file_id', $note->file_id)->update([ |
| 203 | 210 | 'note' => $note->note |
| 204 | 211 | ]); |
@@ -209,14 +216,16 @@ discard block |
||
| 209 | 216 | // Add the documentation column to the tech tips table |
| 210 | 217 | private function addDocumentationColumnToTechTips() |
| 211 | 218 | { |
| 212 | - if(!Schema::hasColumn('tech_tips', 'documentation')) { |
|
| 219 | + if(!Schema::hasColumn('tech_tips', 'documentation')) |
|
| 220 | + { |
|
| 213 | 221 | Schema::table('tech_tips', function(Blueprint $table) { |
| 214 | 222 | $table->boolean('documentation')->default(0)->nullable()->after('public'); |
| 215 | 223 | }); |
| 216 | 224 | |
| 217 | 225 | // Move all of the system files over to the tech tips table |
| 218 | 226 | $sysFiles = DB::select('SELECT * FROM `system_files`'); |
| 219 | - foreach($sysFiles as $sysFile) { |
|
| 227 | + foreach($sysFiles as $sysFile) |
|
| 228 | + { |
|
| 220 | 229 | $newTip = TechTips::create([ |
| 221 | 230 | 'user_id' => $sysFile->user_id, |
| 222 | 231 | 'public' => 0, |
@@ -310,7 +319,8 @@ discard block |
||
| 310 | 319 | // Remove the system files and system file types table |
| 311 | 320 | private function removeSystemFilesTables() |
| 312 | 321 | { |
| 313 | - if(Schema::hasTable('system_files')) { |
|
| 322 | + if(Schema::hasTable('system_files')) |
|
| 323 | + { |
|
| 314 | 324 | Schema::table('system_files', function(Blueprint $table) { |
| 315 | 325 | $table->dropForeign(['sys_id']); |
| 316 | 326 | $table->dropForeign(['type_id']); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\CustomerContacts; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(CustomerContacts::class, function (Faker $faker) { |
|
| 8 | +$factory->define(CustomerContacts::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | // |
| 11 | 11 | 'cust_id' => factory(App\Customers::class)->create(), |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\CustomerNotes; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(CustomerNotes::class, function (Faker $faker) { |
|
| 8 | +$factory->define(CustomerNotes::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | // |
| 11 | 11 | 'cust_id' => factory(App\Customers::class)->create()->cust_id, |