Passed
Push — dev5 ( 3685b3...3ab1f5 )
by Ron
07:25
created
database/factories/TechTipTypes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use App\TechTipTypes;
6 6
 use Faker\Generator as Faker;
7 7
 
8
-$factory->define(TechTipTypes::class, function (Faker $faker) {
8
+$factory->define(TechTipTypes::class, function(Faker $faker) {
9 9
     return [
10 10
         //
11 11
         'description' => $faker->catchPhrase,
Please login to merge, or discard this patch.
database/factories/TechTipSystems.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use App\TechTipSystems;
6 6
 use Faker\Generator as Faker;
7 7
 
8
-$factory->define(TechTipSystems::class, function (Faker $faker) {
8
+$factory->define(TechTipSystems::class, function(Faker $faker) {
9 9
     return [
10 10
         //
11 11
         'tip_id' => factory(App\TechTips::class)->create()->tip_id,
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
@@ -91,8 +90,7 @@  discard block
 block discarded – undo
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::get('search', 'TechTips\TechTipsController@search')->name('search');
97 95
     Route::get('details/{id}/{name}', 'TechTips\TechTipsController@details')->name('details');
98 96
     Route::post('process-image', 'TechTips\TechTipsController@processImage')->name('processImage');
Please login to merge, or discard this patch.
app/Http/Controllers/TechTips/TechTipsController.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  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
             //  No search paramaters, send all tech tips
68 68
             $tips = new TechTipsCollection(
69 69
                 TechTips::orderBy('created_at', 'DESC')
@@ -72,21 +72,21 @@  discard block
 block discarded – undo
72 72
             );
73 73
         } else {
74 74
             $article = isset($request->search['articleType']) ? true : false;
75
-            $system  = isset($request->search['systemType'])  ? true : false;
75
+            $system  = isset($request->search['systemType']) ? true : false;
76 76
             //  Search paramaters, filter results
77 77
             $tips = new TechTipsCollection(
78 78
                 TechTips::orderBy('created_at', 'DESC')
79 79
                     //  Search by id or a phrase in the title or description
80
-                    ->where(function ($query) use ($request) {
81
-                        $query->where('subject', 'like', '%' . $request->search['searchText'] . '%')
82
-                            ->orWhere('tip_id', 'like', '%' . $request->search['searchText'] . '%')
83
-                            ->orWhere('description', 'like', '%' . $request->search['searchText'] . '%');
80
+                    ->where(function($query) use ($request) {
81
+                        $query->where('subject', 'like', '%'.$request->search['searchText'].'%')
82
+                            ->orWhere('tip_id', 'like', '%'.$request->search['searchText'].'%')
83
+                            ->orWhere('description', 'like', '%'.$request->search['searchText'].'%');
84 84
                     })
85
-                    ->when($article, function ($query) use ($request) {
85
+                    ->when($article, function($query) use ($request) {
86 86
                         $query->whereIn('tip_type_id', $request->search['articleType']);
87 87
                     })
88
-                    ->when($system, function ($query) use ($request) {
89
-                        $query->whereHas('SystemTypes', function ($query) use ($request) {
88
+                    ->when($system, function($query) use ($request) {
89
+                        $query->whereHas('SystemTypes', function($query) use ($request) {
90 90
                             $query->whereIn('system_types.sys_id', $request->search['systemType']);
91 91
                         });
92 92
                     })
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         $save = $receiver->receive();
159 159
 
160 160
         //  See if the uploade has finished
161
-        if ($save->isFinished()) {
161
+        if($save->isFinished()) {
162 162
             $this->saveFile($save->getFile());
163 163
 
164 164
             return 'uploaded successfully';
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
         //  Get the current progress
168 168
         $handler = $save->handler();
169 169
 
170
-        Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id);
171
-        Log::debug('File being uploaded.  Percentage done - ' . $handler->getPercentageDone());
170
+        Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id);
171
+        Log::debug('File being uploaded.  Percentage done - '.$handler->getPercentageDone());
172 172
         return response()->json([
173 173
             'done'   => $handler->getPercentageDone(),
174 174
             'status' => true
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         session(['newTipFile' => $fileArr]);
198 198
 
199 199
         //  Log stored file
200
-        Log::info('File Stored', ['file_id' => $fileID, 'file_path' => $filePath . DIRECTORY_SEPARATOR . $fileName]);
200
+        Log::info('File Stored', ['file_id' => $fileID, 'file_path' => $filePath.DIRECTORY_SEPARATOR.$fileName]);
201 201
         return $fileID;
202 202
     }
203 203
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 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';
@@ -252,8 +256,7 @@  discard block
 block discarded – undo
252 256
         if(!$tipData->supressEmail)
253 257
         {
254 258
             $details = TechTips::find($tipID);
255
-            $users = User::where('active', 1)->whereHas('UserSettings', function($query)
256
-            {
259
+            $users = User::where('active', 1)->whereHas('UserSettings', function($query) {
257 260
                 $query->where('em_tech_tip', 1);
258 261
             })->get();
259 262
 
Please login to merge, or discard this patch.
app/Notifications/NewTechTip.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         return [
60 60
             //
61 61
             'type'    => 'warning',
62
-            'message' => 'New Tech Tip Created - ' . $this->details->subject,
62
+            'message' => 'New Tech Tip Created - '.$this->details->subject,
63 63
             'link'    => url(route(
64 64
                 'tip.details',
65 65
                     [
Please login to merge, or discard this patch.