@@ -51,14 +51,17 @@ discard block |
||
| 51 | 51 | Log::debug('request Data -> ', $request->toArray()); |
| 52 | 52 | |
| 53 | 53 | // See if there are any search paramaters entered |
| 54 | - if (!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) { |
|
| 54 | + if (!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) |
|
| 55 | + { |
|
| 55 | 56 | // No search paramaters, send all tech tips |
| 56 | 57 | $tips = new TechTipsCollection( |
| 57 | 58 | TechTips::orderBy('created_at', 'DESC') |
| 58 | 59 | ->with('SystemTypes') |
| 59 | 60 | ->paginate($request->pagination['perPage']) |
| 60 | 61 | ); |
| 61 | - } else { |
|
| 62 | + } |
|
| 63 | + else |
|
| 64 | + { |
|
| 62 | 65 | $article = isset($request->search['articleType']) ? true : false; |
| 63 | 66 | $system = isset($request->search['systemType']) ? true : false; |
| 64 | 67 | // Search paramaters, filter results |
@@ -146,7 +149,8 @@ discard block |
||
| 146 | 149 | $save = $receiver->receive(); |
| 147 | 150 | |
| 148 | 151 | // See if the uploade has finished |
| 149 | - if ($save->isFinished()) { |
|
| 152 | + if ($save->isFinished()) |
|
| 153 | + { |
|
| 150 | 154 | $this->saveFile($save->getFile()); |
| 151 | 155 | |
| 152 | 156 | return 'uploaded successfully'; |
@@ -248,8 +252,7 @@ discard block |
||
| 248 | 252 | if(!$tipData->supressEmail) |
| 249 | 253 | { |
| 250 | 254 | $details = TechTips::find($tipID); |
| 251 | - $users = User::where('active', 1)->whereHas('UserSettings', function($query) |
|
| 252 | - { |
|
| 255 | + $users = User::where('active', 1)->whereHas('UserSettings', function($query) { |
|
| 253 | 256 | $query->where('em_tech_tip', 1); |
| 254 | 257 | })->get(); |
| 255 | 258 | |
@@ -263,7 +266,8 @@ discard block |
||
| 263 | 266 | // Details controller - will move to the show controller with just the tech tip id |
| 264 | 267 | public function details($id, $subject) |
| 265 | 268 | { |
| 266 | - if (session()->has('newTipFile')) { |
|
| 269 | + if (session()->has('newTipFile')) |
|
| 270 | + { |
|
| 267 | 271 | session()->forget('newTipFile'); |
| 268 | 272 | } |
| 269 | 273 | |
@@ -293,7 +297,8 @@ discard block |
||
| 293 | 297 | // Add or remove this tip as a favorite of the user |
| 294 | 298 | public function toggleFav($action, $id) |
| 295 | 299 | { |
| 296 | - switch ($action) { |
|
| 300 | + switch ($action) |
|
| 301 | + { |
|
| 297 | 302 | case 'add': |
| 298 | 303 | TechTipFavs::create([ |
| 299 | 304 | 'user_id' => Auth::user()->user_id, |
@@ -321,7 +326,8 @@ discard block |
||
| 321 | 326 | $this->authorize('hasAccess', 'Edit Tech Tip'); |
| 322 | 327 | $tipData = TechTips::where('tip_id', $id)->with('User')->with('SystemTypes')->with('TechTipTypes')->first(); |
| 323 | 328 | |
| 324 | - if (!$tipData) { |
|
| 329 | + if (!$tipData) |
|
| 330 | + { |
|
| 325 | 331 | return view('tips.tipNotFound'); |
| 326 | 332 | } |
| 327 | 333 | |
@@ -353,7 +359,8 @@ discard block |
||
| 353 | 359 | $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request)); |
| 354 | 360 | |
| 355 | 361 | // Verify if there is a file to be processed or not |
| 356 | - if ($receiver->isUploaded() === false || $request->_completed) { |
|
| 362 | + if ($receiver->isUploaded() === false || $request->_completed) |
|
| 363 | + { |
|
| 357 | 364 | $this->storeUpdatedTip($request, $id); |
| 358 | 365 | Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id); |
| 359 | 366 | return response()->json(['tip_id' => $id]); |
@@ -363,7 +370,8 @@ discard block |
||
| 363 | 370 | $save = $receiver->receive(); |
| 364 | 371 | |
| 365 | 372 | // See if the uploade has finished |
| 366 | - if ($save->isFinished()) { |
|
| 373 | + if ($save->isFinished()) |
|
| 374 | + { |
|
| 367 | 375 | $this->saveFile($save->getFile(), $id); |
| 368 | 376 | |
| 369 | 377 | return 'uploaded successfully'; |
@@ -35,8 +35,7 @@ |
||
| 35 | 35 | // Update the users table to include the 'user_role' column |
| 36 | 36 | if(!Schema::hasColumn('users', 'role_id')) |
| 37 | 37 | { |
| 38 | - Schema::table('users', function(Blueprint $table) |
|
| 39 | - { |
|
| 38 | + Schema::table('users', function(Blueprint $table) { |
|
| 40 | 39 | $table->integer('role_id')->unsigned()->after('user_id')->default(4); |
| 41 | 40 | $table->foreign('role_id')->references('role_id')->on('user_role_types')->onUpdate('cascade'); |
| 42 | 41 | }); |