@@ -8,58 +8,58 @@ discard block |
||
| 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 |
@@ -67,38 +67,38 @@ discard block |
||
| 67 | 67 | Route::prefix('customer')->name('customer.')->group(function() |
| 68 | 68 | { |
| 69 | 69 | // Customer Files |
| 70 | - Route::resource('files', 'Customers\CustomerFilesController'); |
|
| 70 | + Route::resource('files', 'Customers\CustomerFilesController'); |
|
| 71 | 71 | // Custome Notes |
| 72 | - Route::get('download-note/{id}', 'DownloadController@downloadCustNote') ->name('download-note'); |
|
| 73 | - Route::resource('notes', 'Customers\CustomerNotesController'); |
|
| 72 | + Route::get('download-note/{id}', 'DownloadController@downloadCustNote') ->name('download-note'); |
|
| 73 | + Route::resource('notes', 'Customers\CustomerNotesController'); |
|
| 74 | 74 | // Customer Contacts |
| 75 | - Route::resource('contacts', 'Customers\CustomerContactsController'); |
|
| 75 | + Route::resource('contacts', 'Customers\CustomerContactsController'); |
|
| 76 | 76 | // Customer Systems |
| 77 | - Route::resource('systems', 'Customers\CustomerSystemsController'); |
|
| 77 | + Route::resource('systems', 'Customers\CustomerSystemsController'); |
|
| 78 | 78 | // Customer Details |
| 79 | - Route::get('id/{id}/{name}', 'Customers\CustomerDetailsController@details')->name('details'); |
|
| 80 | - Route::resource('id', 'Customers\CustomerDetailsController'); |
|
| 79 | + Route::get('id/{id}/{name}', 'Customers\CustomerDetailsController@details')->name('details'); |
|
| 80 | + Route::resource('id', 'Customers\CustomerDetailsController'); |
|
| 81 | 81 | // check Id and bookmark customer |
| 82 | 82 | Route::get('toggle-fav/{action}/{custID}', 'Customers\CustomerController@toggleFav') ->name('toggle-fav'); |
| 83 | - Route::get('check-id/{id}', 'Customers\CustomerController@checkID') ->name('check-id'); |
|
| 83 | + Route::get('check-id/{id}', 'Customers\CustomerController@checkID') ->name('check-id'); |
|
| 84 | 84 | // Index landing/search page |
| 85 | - Route::get('search', 'Customers\CustomerController@search') ->name('search'); |
|
| 86 | - Route::get('/', 'Customers\CustomerController@index') ->name('index'); |
|
| 85 | + Route::get('search', 'Customers\CustomerController@search') ->name('search'); |
|
| 86 | + Route::get('/', 'Customers\CustomerController@index') ->name('index'); |
|
| 87 | 87 | }); |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | /* |
| 91 | 91 | * Tech Tip Routes |
| 92 | 92 | */ |
| 93 | -Route::resource('tips', 'TechTips\TechTipsController'); |
|
| 93 | +Route::resource('tips', 'TechTips\TechTipsController'); |
|
| 94 | 94 | Route::prefix('tip')->name('tip.')->group(function() |
| 95 | 95 | { |
| 96 | - Route::resource('comments', 'TechTips\TechTipCommentsController'); |
|
| 97 | - Route::get('search', 'TechTips\TechTipsController@search') ->name('search'); |
|
| 98 | - Route::get('details/{id}/{name}', 'TechTips\TechTipsController@details') ->name('details'); |
|
| 99 | - Route::post('process-image', 'TechTips\TechTipsController@processImage')->name('processImage'); |
|
| 96 | + Route::resource('comments', 'TechTips\TechTipCommentsController'); |
|
| 97 | + Route::get('search', 'TechTips\TechTipsController@search') ->name('search'); |
|
| 98 | + Route::get('details/{id}/{name}', 'TechTips\TechTipsController@details') ->name('details'); |
|
| 99 | + Route::post('process-image', 'TechTips\TechTipsController@processImage')->name('processImage'); |
|
| 100 | 100 | Route::get('toggle-fav/{action}/{tipID}', 'TechTips\TechTipsController@toggleFav') ->name('toggle-fav'); |
| 101 | - Route::get('download-tip/{id}', 'DownloadController@downloadTechTip') ->name('downloadTip'); |
|
| 101 | + Route::get('download-tip/{id}', 'DownloadController@downloadTechTip') ->name('downloadTip'); |
|
| 102 | 102 | }); |
| 103 | 103 | |
| 104 | 104 | |
@@ -64,8 +64,7 @@ discard block |
||
| 64 | 64 | /* |
| 65 | 65 | * Customer Routes |
| 66 | 66 | */ |
| 67 | -Route::prefix('customer')->name('customer.')->group(function() |
|
| 68 | -{ |
|
| 67 | +Route::prefix('customer')->name('customer.')->group(function() { |
|
| 69 | 68 | // Customer Files |
| 70 | 69 | Route::resource('files', 'Customers\CustomerFilesController'); |
| 71 | 70 | // Custome Notes |
@@ -91,8 +90,7 @@ discard block |
||
| 91 | 90 | * Tech Tip Routes |
| 92 | 91 | */ |
| 93 | 92 | Route::resource('tips', 'TechTips\TechTipsController'); |
| 94 | -Route::prefix('tip')->name('tip.')->group(function() |
|
| 95 | -{ |
|
| 93 | +Route::prefix('tip')->name('tip.')->group(function() { |
|
| 96 | 94 | Route::resource('comments', 'TechTips\TechTipCommentsController'); |
| 97 | 95 | Route::get('search', 'TechTips\TechTipsController@search') ->name('search'); |
| 98 | 96 | Route::get('details/{id}/{name}', 'TechTips\TechTipsController@details') ->name('details'); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\TechTipComments; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(TechTipComments::class, function (Faker $faker) { |
|
| 8 | +$factory->define(TechTipComments::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | // |
| 11 | 11 | 'tip_id' => factory(App\TechTips::class)->create()->tip_id, |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\TechTipSystems; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(TechTipSystems::class, function () { |
|
| 8 | +$factory->define(TechTipSystems::class, function() { |
|
| 9 | 9 | return [ |
| 10 | 10 | // |
| 11 | 11 | 'tip_id' => factory(App\TechTips::class)->create()->tip_id, |
@@ -360,8 +360,8 @@ |
||
| 360 | 360 | // Add soft deletes to tech tips table to prevent accidental deletes |
| 361 | 361 | private function addSoftDeleteToTechTips() |
| 362 | 362 | { |
| 363 | - if (!Schema::hasColumn('tech_tips', 'deleted_at')) { |
|
| 364 | - Schema::table('tech_tips', function (Blueprint $table) { |
|
| 363 | + if(!Schema::hasColumn('tech_tips', 'deleted_at')) { |
|
| 364 | + Schema::table('tech_tips', function(Blueprint $table) { |
|
| 365 | 365 | $table->softDeletes()->after('description'); |
| 366 | 366 | }); |
| 367 | 367 | } |
@@ -82,7 +82,8 @@ discard block |
||
| 82 | 82 | // Added the ability to set an expiration date for user passwords - will force them to change after this expires |
| 83 | 83 | private function addPasswordExpiresColumn() |
| 84 | 84 | { |
| 85 | - if(!Schema::hasColumn('users', 'password_expires')) { |
|
| 85 | + if(!Schema::hasColumn('users', 'password_expires')) |
|
| 86 | + { |
|
| 86 | 87 | Schema::table('users', function(Blueprint $table) { |
| 87 | 88 | $table->timestamp('password_expires') |
| 88 | 89 | ->nullable() |
@@ -153,7 +154,8 @@ discard block |
||
| 153 | 154 | // Added a 'hidden' attribute to system customer data types to allow passwords to not be viewed unless clicked or focus |
| 154 | 155 | private function addHiddenColumn() |
| 155 | 156 | { |
| 156 | - if(!Schema::hasColumn('system_data_field_types', 'hidden')) { |
|
| 157 | + if(!Schema::hasColumn('system_data_field_types', 'hidden')) |
|
| 158 | + { |
|
| 157 | 159 | Schema::table('system_cust_data_types', function(Blueprint $table) { |
| 158 | 160 | $table->boolean('hidden') |
| 159 | 161 | ->default(0) |
@@ -165,7 +167,8 @@ discard block |
||
| 165 | 167 | // Update the File links table - add cust_id and note column |
| 166 | 168 | private function addColumnsToFileLinksTable() |
| 167 | 169 | { |
| 168 | - if(!Schema::hasColumn('file_links', 'cust_id')) { |
|
| 170 | + if(!Schema::hasColumn('file_links', 'cust_id')) |
|
| 171 | + { |
|
| 169 | 172 | Schema::table('file_links', function(Blueprint $table) { |
| 170 | 173 | $table->integer('cust_id') |
| 171 | 174 | ->unsigned() |
@@ -174,7 +177,8 @@ discard block |
||
| 174 | 177 | $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade'); |
| 175 | 178 | }); |
| 176 | 179 | } |
| 177 | - if(!Schema::hasColumn('file_links', 'note')) { |
|
| 180 | + if(!Schema::hasColumn('file_links', 'note')) |
|
| 181 | + { |
|
| 178 | 182 | Schema::table('file_links', function(Blueprint $table) { |
| 179 | 183 | $table->longText('note') |
| 180 | 184 | ->nullable() |
@@ -182,7 +186,8 @@ discard block |
||
| 182 | 186 | }); |
| 183 | 187 | // Migrate the instructions from the old table to the new column |
| 184 | 188 | $instructions = DB::select('SELECT * FROM `file_link_instructions`'); |
| 185 | - foreach($instructions as $ins) { |
|
| 189 | + foreach($instructions as $ins) |
|
| 190 | + { |
|
| 186 | 191 | FileLinks::find($ins->link_id)->update([ |
| 187 | 192 | 'note' => $ins->instruction |
| 188 | 193 | ]); |
@@ -193,7 +198,8 @@ discard block |
||
| 193 | 198 | // Add Notes column to the file links files table |
| 194 | 199 | private function addNotesColumnToFileLinkFiles() |
| 195 | 200 | { |
| 196 | - if(!Schema::hasColumn('file_link_files', 'note')) { |
|
| 201 | + if(!Schema::hasColumn('file_link_files', 'note')) |
|
| 202 | + { |
|
| 197 | 203 | Schema::table('file_link_files', function(Blueprint $table) { |
| 198 | 204 | $table->longText('note') |
| 199 | 205 | ->nullable() |
@@ -201,7 +207,8 @@ discard block |
||
| 201 | 207 | }); |
| 202 | 208 | // Migrate the existing notes to the new table |
| 203 | 209 | $notes = DB::select('SELECT * FROM `file_link_notes`'); |
| 204 | - foreach($notes as $note) { |
|
| 210 | + foreach($notes as $note) |
|
| 211 | + { |
|
| 205 | 212 | FileLinkFiles::where('file_id', $note->file_id)->update([ |
| 206 | 213 | 'note' => $note->note |
| 207 | 214 | ]); |
@@ -212,7 +219,8 @@ discard block |
||
| 212 | 219 | // Add the documentation column to the tech tips table |
| 213 | 220 | private function migrateSystemDocumentation() |
| 214 | 221 | { |
| 215 | - if(!Schema::hasColumn('tech_tips', 'tip_type_id')) { |
|
| 222 | + if(!Schema::hasColumn('tech_tips', 'tip_type_id')) |
|
| 223 | + { |
|
| 216 | 224 | Schema::table('tech_tips', function(Blueprint $table) { |
| 217 | 225 | $table->bigInteger('tip_type_id')->unsigned()->after('public')->default(1); |
| 218 | 226 | $table->foreign('tip_type_id')->references('tip_type_id')->on('tech_tip_types')->onUpdate('cascade'); |
@@ -220,7 +228,8 @@ discard block |
||
| 220 | 228 | |
| 221 | 229 | // Move all of the system files over to the tech tips table |
| 222 | 230 | $sysFiles = DB::select('SELECT * FROM `system_files`'); |
| 223 | - foreach($sysFiles as $sysFile) { |
|
| 231 | + foreach($sysFiles as $sysFile) |
|
| 232 | + { |
|
| 224 | 233 | $newTip = TechTips::create([ |
| 225 | 234 | 'user_id' => $sysFile->user_id, |
| 226 | 235 | 'public' => 0, |
@@ -314,7 +323,8 @@ discard block |
||
| 314 | 323 | // Remove the system files and system file types table |
| 315 | 324 | private function removeSystemFilesTables() |
| 316 | 325 | { |
| 317 | - if(Schema::hasTable('system_files')) { |
|
| 326 | + if(Schema::hasTable('system_files')) |
|
| 327 | + { |
|
| 318 | 328 | Schema::table('system_files', function(Blueprint $table) { |
| 319 | 329 | $table->dropForeign(['sys_id']); |
| 320 | 330 | $table->dropForeign(['type_id']); |
@@ -360,7 +370,8 @@ discard block |
||
| 360 | 370 | // Add soft deletes to tech tips table to prevent accidental deletes |
| 361 | 371 | private function addSoftDeleteToTechTips() |
| 362 | 372 | { |
| 363 | - if (!Schema::hasColumn('tech_tips', 'deleted_at')) { |
|
| 373 | + if (!Schema::hasColumn('tech_tips', 'deleted_at')) |
|
| 374 | + { |
|
| 364 | 375 | Schema::table('tech_tips', function (Blueprint $table) { |
| 365 | 376 | $table->softDeletes()->after('description'); |
| 366 | 377 | }); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | Log::debug('request Data -> ', $request->toArray()); |
| 63 | 63 | |
| 64 | 64 | // See if there are any search paramaters entered |
| 65 | - if (!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) { |
|
| 65 | + if(!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) { |
|
| 66 | 66 | // No search paramaters, send all tech tips |
| 67 | 67 | $tips = new TechTipsCollection( |
| 68 | 68 | TechTips::orderBy('created_at', 'DESC') |
@@ -71,21 +71,21 @@ discard block |
||
| 71 | 71 | ); |
| 72 | 72 | } else { |
| 73 | 73 | $article = isset($request->search['articleType']) ? true : false; |
| 74 | - $system = isset($request->search['systemType']) ? true : false; |
|
| 74 | + $system = isset($request->search['systemType']) ? true : false; |
|
| 75 | 75 | // Search paramaters, filter results |
| 76 | 76 | $tips = new TechTipsCollection( |
| 77 | 77 | TechTips::orderBy('created_at', 'DESC') |
| 78 | 78 | // Search by id or a phrase in the title or description |
| 79 | - ->where(function ($query) use ($request) { |
|
| 80 | - $query->where('subject', 'like', '%' . $request->search['searchText'] . '%') |
|
| 81 | - ->orWhere('tip_id', 'like', '%' . $request->search['searchText'] . '%') |
|
| 82 | - ->orWhere('description', 'like', '%' . $request->search['searchText'] . '%'); |
|
| 79 | + ->where(function($query) use ($request) { |
|
| 80 | + $query->where('subject', 'like', '%'.$request->search['searchText'].'%') |
|
| 81 | + ->orWhere('tip_id', 'like', '%'.$request->search['searchText'].'%') |
|
| 82 | + ->orWhere('description', 'like', '%'.$request->search['searchText'].'%'); |
|
| 83 | 83 | }) |
| 84 | - ->when($article, function ($query) use ($request) { |
|
| 84 | + ->when($article, function($query) use ($request) { |
|
| 85 | 85 | $query->whereIn('tip_type_id', $request->search['articleType']); |
| 86 | 86 | }) |
| 87 | - ->when($system, function ($query) use ($request) { |
|
| 88 | - $query->whereHas('SystemTypes', function ($query) use ($request) { |
|
| 87 | + ->when($system, function($query) use ($request) { |
|
| 88 | + $query->whereHas('SystemTypes', function($query) use ($request) { |
|
| 89 | 89 | $query->whereIn('system_types.sys_id', $request->search['systemType']); |
| 90 | 90 | }); |
| 91 | 91 | }) |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $save = $receiver->receive(); |
| 158 | 158 | |
| 159 | 159 | // See if the uploade has finished |
| 160 | - if ($save->isFinished()) { |
|
| 160 | + if($save->isFinished()) { |
|
| 161 | 161 | $this->saveFile($save->getFile()); |
| 162 | 162 | |
| 163 | 163 | return 'uploaded successfully'; |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | // Get the current progress |
| 167 | 167 | $handler = $save->handler(); |
| 168 | 168 | |
| 169 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
|
| 170 | - Log::debug('File being uploaded. Percentage done - ' . $handler->getPercentageDone()); |
|
| 169 | + Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
|
| 170 | + Log::debug('File being uploaded. Percentage done - '.$handler->getPercentageDone()); |
|
| 171 | 171 | return response()->json([ |
| 172 | 172 | 'done' => $handler->getPercentageDone(), |
| 173 | 173 | 'status' => true |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | session(['newTipFile' => $fileArr]); |
| 197 | 197 | |
| 198 | 198 | // Log stored file |
| 199 | - Log::info('File Stored', ['file_id' => $fileID, 'file_path' => $filePath . DIRECTORY_SEPARATOR . $fileName]); |
|
| 199 | + Log::info('File Stored', ['file_id' => $fileID, 'file_path' => $filePath.DIRECTORY_SEPARATOR.$fileName]); |
|
| 200 | 200 | return $fileID; |
| 201 | 201 | } |
| 202 | 202 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | // Details controller - will move to the show controller with just the tech tip id |
| 267 | 267 | public function details($id, $subject) |
| 268 | 268 | { |
| 269 | - if (session()->has('newTipFile')) { |
|
| 269 | + if(session()->has('newTipFile')) { |
|
| 270 | 270 | session()->forget('newTipFile'); |
| 271 | 271 | } |
| 272 | 272 | |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | public function toggleFav($action, $id) |
| 301 | 301 | { |
| 302 | 302 | // |
| 303 | - switch ($action) { |
|
| 303 | + switch($action) { |
|
| 304 | 304 | case 'add': |
| 305 | 305 | TechTipFavs::create([ |
| 306 | 306 | 'user_id' => Auth::user()->user_id, |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | break; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
|
| 316 | + Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
|
| 317 | 317 | Log::debug('Tech Tip Bookmark Updated.', [ |
| 318 | 318 | 'user_id' => Auth::user()->user_id, |
| 319 | 319 | 'tip_id' => $id, |
@@ -62,14 +62,17 @@ discard block |
||
| 62 | 62 | Log::debug('request Data -> ', $request->toArray()); |
| 63 | 63 | |
| 64 | 64 | // See if there are any search paramaters entered |
| 65 | - if (!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) { |
|
| 65 | + if (!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) |
|
| 66 | + { |
|
| 66 | 67 | // No search paramaters, send all tech tips |
| 67 | 68 | $tips = new TechTipsCollection( |
| 68 | 69 | TechTips::orderBy('created_at', 'DESC') |
| 69 | 70 | ->with('SystemTypes') |
| 70 | 71 | ->paginate($request->pagination['perPage']) |
| 71 | 72 | ); |
| 72 | - } else { |
|
| 73 | + } |
|
| 74 | + else |
|
| 75 | + { |
|
| 73 | 76 | $article = isset($request->search['articleType']) ? true : false; |
| 74 | 77 | $system = isset($request->search['systemType']) ? true : false; |
| 75 | 78 | // Search paramaters, filter results |
@@ -157,7 +160,8 @@ discard block |
||
| 157 | 160 | $save = $receiver->receive(); |
| 158 | 161 | |
| 159 | 162 | // See if the uploade has finished |
| 160 | - if ($save->isFinished()) { |
|
| 163 | + if ($save->isFinished()) |
|
| 164 | + { |
|
| 161 | 165 | $this->saveFile($save->getFile()); |
| 162 | 166 | |
| 163 | 167 | return 'uploaded successfully'; |
@@ -251,8 +255,7 @@ discard block |
||
| 251 | 255 | if(!$tipData->supressEmail) |
| 252 | 256 | { |
| 253 | 257 | $details = TechTips::find($tipID); |
| 254 | - $users = User::where('active', 1)->whereHas('UserSettings', function($query) |
|
| 255 | - { |
|
| 258 | + $users = User::where('active', 1)->whereHas('UserSettings', function($query) { |
|
| 256 | 259 | $query->where('em_tech_tip', 1); |
| 257 | 260 | })->get(); |
| 258 | 261 | |
@@ -266,7 +269,8 @@ discard block |
||
| 266 | 269 | // Details controller - will move to the show controller with just the tech tip id |
| 267 | 270 | public function details($id, $subject) |
| 268 | 271 | { |
| 269 | - if (session()->has('newTipFile')) { |
|
| 272 | + if (session()->has('newTipFile')) |
|
| 273 | + { |
|
| 270 | 274 | session()->forget('newTipFile'); |
| 271 | 275 | } |
| 272 | 276 | |
@@ -300,7 +304,8 @@ discard block |
||
| 300 | 304 | public function toggleFav($action, $id) |
| 301 | 305 | { |
| 302 | 306 | // |
| 303 | - switch ($action) { |
|
| 307 | + switch ($action) |
|
| 308 | + { |
|
| 304 | 309 | case 'add': |
| 305 | 310 | TechTipFavs::create([ |
| 306 | 311 | 'user_id' => Auth::user()->user_id, |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | // Verify that the upload is valid and being processed |
| 49 | 49 | if($receiver->isUploaded() === false) |
| 50 | 50 | { |
| 51 | - Log::error('Upload File Missing - ' . |
|
| 51 | + Log::error('Upload File Missing - '. |
|
| 52 | 52 | /** @scrutinizer ignore-type */ |
| 53 | 53 | $request->toArray()); |
| 54 | 54 | throw new UploadMissingFileException(); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | use SoftDeletes; |
| 11 | 11 | |
| 12 | 12 | protected $primaryKey = 'tip_id'; |
| 13 | - protected $fillable = ['user_id', 'subject', 'tip_type_id', 'description', 'created_at']; // ToDo: Remove Created_at - future build |
|
| 13 | + protected $fillable = ['user_id', 'subject', 'tip_type_id', 'description', 'created_at']; // ToDo: Remove Created_at - future build |
|
| 14 | 14 | protected $hidden = ['public', 'user_id', 'tip_type_id']; |
| 15 | 15 | protected $casts = [ |
| 16 | 16 | 'created_at' => 'datetime:M d, Y', |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public function systemTypes() |
| 21 | 21 | { |
| 22 | - return $this->hasManyThrough('App\SystemTypes', 'App\TechTipSystems', 'tip_id', 'sys_id', 'tip_id', 'sys_id'); |
|
| 22 | + return $this->hasManyThrough('App\SystemTypes', 'App\TechTipSystems', 'tip_id', 'sys_id', 'tip_id', 'sys_id'); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function user() |