Passed
Push — dev5 ( 1f5b4d...1c738e )
by Ron
05:57
created
app/Http/Controllers/TechTips/TechTipsController.php 1 patch
Braces   +18 added lines, -10 removed lines patch added patch discarded remove patch
@@ -63,14 +63,17 @@  discard block
 block discarded – undo
63 63
         Log::debug('request Data -> ', $request->toArray());
64 64
 
65 65
         //  See if there are any search paramaters entered
66
-        if (!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) {
66
+        if (!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType']))
67
+        {
67 68
             //  No search paramaters, send all tech tips
68 69
             $tips = new TechTipsCollection(
69 70
                 TechTips::orderBy('created_at', 'DESC')
70 71
                     ->with('SystemTypes')
71 72
                     ->paginate($request->pagination['perPage'])
72 73
             );
73
-        } else {
74
+        }
75
+        else
76
+        {
74 77
             $article = isset($request->search['articleType']) ? true : false;
75 78
             $system  = isset($request->search['systemType'])  ? true : false;
76 79
             //  Search paramaters, filter results
@@ -158,7 +161,8 @@  discard block
 block discarded – undo
158 161
         $save = $receiver->receive();
159 162
 
160 163
         //  See if the uploade has finished
161
-        if ($save->isFinished()) {
164
+        if ($save->isFinished())
165
+        {
162 166
             $this->saveFile($save->getFile());
163 167
 
164 168
             return 'uploaded successfully';
@@ -264,8 +268,7 @@  discard block
 block discarded – undo
264 268
         if(!$tipData->supressEmail)
265 269
         {
266 270
             $details = TechTips::find($tipID);
267
-            $users = User::where('active', 1)->whereHas('UserSettings', function($query)
268
-            {
271
+            $users = User::where('active', 1)->whereHas('UserSettings', function($query) {
269 272
                 $query->where('em_tech_tip', 1);
270 273
             })->get();
271 274
 
@@ -279,7 +282,8 @@  discard block
 block discarded – undo
279 282
     //  Details controller - will move to the show controller with just the tech tip id
280 283
     public function details($id, $subject)
281 284
     {
282
-        if (session()->has('newTipFile')) {
285
+        if (session()->has('newTipFile'))
286
+        {
283 287
             session()->forget('newTipFile');
284 288
         }
285 289
 
@@ -309,7 +313,8 @@  discard block
 block discarded – undo
309 313
     //  Add or remove this tip as a favorite of the user
310 314
     public function toggleFav($action, $id)
311 315
     {
312
-        switch ($action) {
316
+        switch ($action)
317
+        {
313 318
             case 'add':
314 319
                 TechTipFavs::create([
315 320
                     'user_id' => Auth::user()->user_id,
@@ -337,7 +342,8 @@  discard block
 block discarded – undo
337 342
         $this->authorize('hasAccess', 'edit_tech_tip');
338 343
         $tipData = TechTips::where('tip_id', $id)->with('User')->with('SystemTypes')->with('TechTipTypes')->first();
339 344
 
340
-        if (!$tipData) {
345
+        if (!$tipData)
346
+        {
341 347
             return view('tips.tipNotFound');
342 348
         }
343 349
 
@@ -370,7 +376,8 @@  discard block
 block discarded – undo
370 376
         $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request));
371 377
 
372 378
         //  Verify if there is a file to be processed or not
373
-        if ($receiver->isUploaded() === false || $request->_completed) {
379
+        if ($receiver->isUploaded() === false || $request->_completed)
380
+        {
374 381
             $this->storeUpdatedTip($request, $id);
375 382
             Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id);
376 383
             return response()->json(['tip_id' => $id]);
@@ -380,7 +387,8 @@  discard block
 block discarded – undo
380 387
         $save = $receiver->receive();
381 388
 
382 389
         //  See if the uploade has finished
383
-        if ($save->isFinished()) {
390
+        if ($save->isFinished())
391
+        {
384 392
             $this->saveFile($save->getFile(), $id);
385 393
 
386 394
             return 'uploaded successfully';
Please login to merge, or discard this patch.
routes/web.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,8 +64,7 @@  discard block
 block discarded – undo
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
@@ -92,8 +91,7 @@  discard block
 block discarded – undo
92 91
 */
93 92
 Route::resource('tips',                       'TechTips\TechTipsController');
94 93
 Route::post('submit-edit/{id}', 'TechTips\TechTipsController@update')->name('tips.submit-edit');
95
-Route::prefix('tip')->name('tip.')->group(function()
96
-{
94
+Route::prefix('tip')->name('tip.')->group(function() {
97 95
     Route::resource('comments',               'TechTips\TechTipCommentsController');
98 96
     Route::get('search',                      'TechTips\TechTipsController@search')      ->name('search');
99 97
     Route::get('details/{id}/{name}',         'TechTips\TechTipsController@details')     ->name('details');
Please login to merge, or discard this patch.