Passed
Push — dev5 ( 3685b3...3ab1f5 )
by Ron
07:25
created
app/Http/Middleware/RedirectIfAuthenticated.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,8 @@
 block discarded – undo
17 17
      */
18 18
     public function handle($request, Closure $next, $guard = null)
19 19
     {
20
-        if(Auth::guard($guard)->check()) {
20
+        if(Auth::guard($guard)->check())
21
+        {
21 22
             return redirect('/dashboard');
22 23
         }
23 24
 
Please login to merge, or discard this patch.
app/Http/Controllers/Customers/CustomerController.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,8 +47,7 @@  discard block
 block discarded – undo
47 47
             $searchResults = new CustomersCollection(
48 48
                 Customers::orderBy($request->sortField, $request->sortType)
49 49
                     //  Search the name, dba name, and cust id columns
50
-                    ->where(function($query) use ($request)
51
-                    {
50
+                    ->where(function($query) use ($request) {
52 51
                         $query->where('name', 'like', '%' . $request->name . '%')
53 52
                             ->orWhere('cust_id', 'like', '%' . $request->name . '%')
54 53
                             ->orWhere('dba_name', 'like', '%' . $request->name . '%');
@@ -58,10 +57,8 @@  discard block
 block discarded – undo
58 57
                     //  Include the customers systems
59 58
                     ->with('CustomerSystems.SystemTypes')
60 59
                     //  If the system field is present - search for system type
61
-                    ->when($request->system, function($query) use ($request)
62
-                    {
63
-                        $query->whereHas('CustomerSystems.SystemTypes', function($query) use ($request)
64
-                        {
60
+                    ->when($request->system, function($query) use ($request) {
61
+                        $query->whereHas('CustomerSystems.SystemTypes', function($query) use ($request) {
65 62
                             $query->where('sys_id', $request->system);
66 63
                         });
67 64
                     })
Please login to merge, or discard this patch.
database/seeds/UserTableSeeder.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@
 block discarded – undo
12 12
     public function run()
13 13
     {
14 14
         //  Create the test users - note, none are installers - permissions are assigned randomly
15
-        factory(App\User::class, 15)->create()->each(function($user)
16
-        {
15
+        factory(App\User::class, 15)->create()->each(function($user) {
17 16
             $user->UserPermissions()->save(factory(App\UserPermissions::class)->create(['user_id' => $user->user_id]));
18 17
         });
19 18
     }
Please login to merge, or discard this patch.
database/migrations/2019_11_25_175205_updates_for_version_5_0.php 1 patch
Braces   +20 added lines, -10 removed lines patch added patch discarded remove patch
@@ -81,7 +81,8 @@  discard block
 block discarded – undo
81 81
     //  Added the ability to set an expiration date for user passwords - will force them to change after this expires
82 82
     private function addPasswordExpiresColumn()
83 83
     {
84
-        if(!Schema::hasColumn('users', 'password_expires')) {
84
+        if(!Schema::hasColumn('users', 'password_expires'))
85
+        {
85 86
             Schema::table('users', function(Blueprint $table) {
86 87
                 $table->timestamp('password_expires')
87 88
                     ->nullable()
@@ -151,7 +152,8 @@  discard block
 block discarded – undo
151 152
     //  Added a 'hidden' attribute to system customer data types to allow passwords to not be viewed unless clicked or focus
152 153
     private function addHiddenColumn()
153 154
     {
154
-        if(!Schema::hasColumn('system_data_field_types', 'hidden')) {
155
+        if(!Schema::hasColumn('system_data_field_types', 'hidden'))
156
+        {
155 157
             Schema::table('system_cust_data_types', function(Blueprint $table) {
156 158
                 $table->boolean('hidden')
157 159
                     ->default(0)
@@ -163,7 +165,8 @@  discard block
 block discarded – undo
163 165
     //  Update the File links table - add cust_id and note column
164 166
     private function addColumnsToFileLinksTable()
165 167
     {
166
-        if(!Schema::hasColumn('file_links', 'cust_id')) {
168
+        if(!Schema::hasColumn('file_links', 'cust_id'))
169
+        {
167 170
             Schema::table('file_links', function(Blueprint $table) {
168 171
                 $table->integer('cust_id')
169 172
                     ->unsigned()
@@ -172,7 +175,8 @@  discard block
 block discarded – undo
172 175
                 $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade');
173 176
             });
174 177
         }
175
-        if(!Schema::hasColumn('file_links', 'note')) {
178
+        if(!Schema::hasColumn('file_links', 'note'))
179
+        {
176 180
             Schema::table('file_links', function(Blueprint $table) {
177 181
                 $table->longText('note')
178 182
                     ->nullable()
@@ -180,7 +184,8 @@  discard block
 block discarded – undo
180 184
             });
181 185
             //  Migrate the instructions from the old table to the new column
182 186
             $instructions = DB::select('SELECT * FROM `file_link_instructions`');
183
-            foreach($instructions as $ins) {
187
+            foreach($instructions as $ins)
188
+            {
184 189
                 FileLinks::find($ins->link_id)->update([
185 190
                     'note' => $ins->instruction
186 191
                 ]);
@@ -191,7 +196,8 @@  discard block
 block discarded – undo
191 196
     //  Add Notes column to the file links files table
192 197
     private function addNotesColumnToFileLinkFiles()
193 198
     {
194
-        if(!Schema::hasColumn('file_link_files', 'note')) {
199
+        if(!Schema::hasColumn('file_link_files', 'note'))
200
+        {
195 201
             Schema::table('file_link_files', function(Blueprint $table) {
196 202
                 $table->longText('note')
197 203
                     ->nullable()
@@ -199,7 +205,8 @@  discard block
 block discarded – undo
199 205
             });
200 206
             //  Migrate the existing notes to the new table
201 207
             $notes = DB::select('SELECT * FROM `file_link_notes`');
202
-            foreach($notes as $note) {
208
+            foreach($notes as $note)
209
+            {
203 210
                 FileLinkFiles::where('file_id', $note->file_id)->update([
204 211
                     'note' => $note->note
205 212
                 ]);
@@ -210,7 +217,8 @@  discard block
 block discarded – undo
210 217
     //  Add the documentation column to the tech tips table
211 218
     private function migrateSystemDocumentation()
212 219
     {
213
-        if(!Schema::hasColumn('tech_tips', 'tip_type_id')) {
220
+        if(!Schema::hasColumn('tech_tips', 'tip_type_id'))
221
+        {
214 222
             Schema::table('tech_tips', function(Blueprint $table) {
215 223
                 $table->bigInteger('tip_type_id')->unsigned()->after('public')->default(1);
216 224
                 $table->foreign('tip_type_id')->references('tip_type_id')->on('tech_tip_types')->onUpdate('cascade');
@@ -218,7 +226,8 @@  discard block
 block discarded – undo
218 226
 
219 227
             //  Move all of the system files over to the tech tips table
220 228
             $sysFiles = DB::select('SELECT * FROM `system_files`');
221
-            foreach($sysFiles as $sysFile) {
229
+            foreach($sysFiles as $sysFile)
230
+            {
222 231
                 $newTip = TechTips::create([
223 232
                     'user_id'       => $sysFile->user_id,
224 233
                     'public'        => 0,
@@ -312,7 +321,8 @@  discard block
 block discarded – undo
312 321
     //  Remove the system files and system file types table
313 322
     private function removeSystemFilesTables()
314 323
     {
315
-        if(Schema::hasTable('system_files')) {
324
+        if(Schema::hasTable('system_files'))
325
+        {
316 326
             Schema::table('system_files', function(Blueprint $table) {
317 327
                 $table->dropForeign(['sys_id']);
318 328
                 $table->dropForeign(['type_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 1 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.