Passed
Push — master ( 51742c...2db616 )
by Thomas
06:34
created
app/Http/Controllers/Admin/CourseCrudController.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         CRUD::addClause('internal');
57 57
         $permissions = backpack_user()->getAllPermissions();
58 58
 
59
-        if (! $permissions->contains('name', 'courses.edit')) {
59
+        if (!$permissions->contains('name', 'courses.edit')) {
60 60
             CRUD::denyAccess('update');
61 61
             CRUD::denyAccess('create');
62 62
         }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
         CRUD::addButtonFromView('line', 'children_badge', 'children_badge', 'beginning');
69 69
 
70
-        if (! $permissions->contains('name', 'courses.delete')) {
70
+        if (!$permissions->contains('name', 'courses.delete')) {
71 71
             CRUD::denyAccess('delete');
72 72
         }
73 73
 
@@ -189,13 +189,13 @@  discard block
 block discarded – undo
189 189
             'name' => 'rhythm_id',
190 190
             'type' => 'select2',
191 191
             'label'=> __('Rhythm'),
192
-        ], function () {
192
+        ], function() {
193 193
             return Rhythm::all()->pluck('name', 'id')->toArray();
194
-        }, function ($value) {
194
+        }, function($value) {
195 195
             // if the filter is active
196 196
             CRUD::addClause('where', 'rhythm_id', $value);
197 197
         },
198
-        function () {
198
+        function() {
199 199
             // if the filter is NOT active (the GET parameter "checkbox" does not exit)
200 200
         });
201 201
 
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
             'name' => 'teacher_id',
204 204
             'type' => 'select2',
205 205
             'label'=> __('Teacher'),
206
-        ], function () {
206
+        ], function() {
207 207
             return Teacher::all()->pluck('name', 'id')->toArray();
208
-        }, function ($value) {
208
+        }, function($value) {
209 209
             // if the filter is active
210 210
             CRUD::addClause('where', 'teacher_id', $value);
211 211
         },
212
-        function () {
212
+        function() {
213 213
             // if the filter is NOT active (the GET parameter "checkbox" does not exit)
214 214
         });
215 215
 
@@ -217,13 +217,13 @@  discard block
 block discarded – undo
217 217
             'name' => 'level_id',
218 218
             'type' => 'select2',
219 219
             'label'=> __('Level'),
220
-        ], function () {
220
+        ], function() {
221 221
             return Level::all()->pluck('name', 'id')->toArray();
222
-        }, function ($value) {
222
+        }, function($value) {
223 223
             // if the filter is active
224 224
             CRUD::addClause('where', 'level_id', $value);
225 225
         },
226
-        function () {
226
+        function() {
227 227
             // if the filter is NOT active (the GET parameter "checkbox" does not exit)
228 228
         });
229 229
 
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
             'type' => 'select2',
233 233
             'label'=> __('Period'),
234 234
         ],
235
-            function () {
235
+            function() {
236 236
             return \App\Models\Period::all()->sortByDesc('id')->pluck('name', 'id')->toArray();
237 237
         },
238
-            function ($value) { // if the filter is active
238
+            function($value) { // if the filter is active
239 239
             CRUD::addClause('where', 'period_id', $value);
240 240
         },
241
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
241
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
242 242
               $period = \App\Models\Period::get_default_period()->id;
243 243
               CRUD::addClause('where', 'period_id', $period);
244 244
               $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
         );
247 247
 
248 248
         CRUD::addFilter(
249
-            [ // add a "simple" filter called Draft
249
+            [// add a "simple" filter called Draft
250 250
             'type' => 'simple',
251 251
             'name' => 'parent',
252 252
             'label'=> __('Hide Children Courses'),
253 253
         ],
254 254
             false,
255
-            function () {
255
+            function() {
256 256
               CRUD::addClause('parent');
257 257
           }
258 258
         );
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
             'label' => __('Start')
264 264
         ],
265 265
             false,
266
-            function ($value) { // if the filter is active, apply these constraints
266
+            function($value) { // if the filter is active, apply these constraints
267 267
                 $dates = json_decode($value);
268 268
                 $this->crud->addClause('where', 'start_date', '>=', $dates->from);
269
-                $this->crud->addClause('where', 'start_date', '<=', $dates->to . ' 23:59:59');
269
+                $this->crud->addClause('where', 'start_date', '<=', $dates->to.' 23:59:59');
270 270
             });
271 271
 
272 272
         $this->crud->addFilter([
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
             'label' => __('End')
276 276
         ],
277 277
             false,
278
-            function ($value) { // if the filter is active, apply these constraints
278
+            function($value) { // if the filter is active, apply these constraints
279 279
                 $dates = json_decode($value);
280 280
                 $this->crud->addClause('where', 'end_date', '>=', $dates->from);
281
-                $this->crud->addClause('where', 'end_date', '<=', $dates->to . ' 23:59:59');
281
+                $this->crud->addClause('where', 'end_date', '<=', $dates->to.' 23:59:59');
282 282
             });
283 283
     }
284 284
 
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
             ],
355 355
 
356 356
 
357
-            [   // repeatable
357
+            [// repeatable
358 358
                 'name'  => 'sublevels',
359 359
                 'label' => __('Course sublevels'),
360 360
                 'type'  => 'repeatable',
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                 'default' => Period::get_enrollments_period()->end,
512 512
             ],
513 513
 
514
-            [   // repeatable
514
+            [// repeatable
515 515
                 'name'  => 'times',
516 516
                 'label' => __('Course Schedule'),
517 517
                 'type'  => 'repeatable',
@@ -574,14 +574,14 @@  discard block
 block discarded – undo
574 574
                 'init_rows' => 0, // number of empty rows to be initialized, by default 1
575 575
             ],
576 576
 
577
-            [   // view
577
+            [// view
578 578
                 'name' => 'custom-ajax-button',
579 579
                 'type' => 'view',
580 580
                 'view' => 'courses/schedule-preset-alert',
581 581
                 'tab' => __('Schedule'),
582 582
             ],
583 583
 
584
-            [   // select_from_array
584
+            [// select_from_array
585 585
                 'name'        => 'schedulepreset',
586 586
                 'label'       => __('Schedule Preset'),
587 587
                 'type'        => 'select_from_array',
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
         }
606 606
 
607 607
         if ($this->crud->getCurrentEntry()->children->count() > 0) {
608
-            CRUD::addField([   // view
608
+            CRUD::addField([// view
609 609
                 'name' => 'custom-ajax-button',
610 610
                 'type' => 'view',
611 611
                 'view' => 'courses/parent-course-alert'
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
         }
614 614
 
615 615
         if ($this->crud->getCurrentEntry()->parent_course_id !== null) {
616
-            CRUD::addField([   // view
616
+            CRUD::addField([// view
617 617
                 'name' => 'custom-ajax-button',
618 618
                 'type' => 'view',
619 619
                 'view' => 'courses/child-course-alert'
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/TeacherCrudController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
                 'attribute' => 'lastname', // foreign key attribute that is shown to user
49 49
                 'model'     => 'App\Models\User', // foreign key model
50 50
                 'orderable' => true,
51
-                'orderLogic' => function ($query, $column, $columnDirection) {
51
+                'orderLogic' => function($query, $column, $columnDirection) {
52 52
                     return $query->leftJoin('users', 'users.id', '=', 'students.id')
53 53
                         ->orderBy('users.lastname', $columnDirection)->select('students.*');
54 54
                 },
55
-                'searchLogic' => function ($query, $column, $searchTerm) {
56
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
55
+                'searchLogic' => function($query, $column, $searchTerm) {
56
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
57 57
                         $q->where('lastname', 'like', '%'.$searchTerm.'%');
58 58
                     });
59 59
                 },
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
                 'attribute' => 'firstname', // foreign key attribute that is shown to user
69 69
                 'model'     => 'App\Models\User', // foreign key model
70 70
                 'orderable' => true,
71
-                'orderLogic' => function ($query, $column, $columnDirection) {
71
+                'orderLogic' => function($query, $column, $columnDirection) {
72 72
                     return $query->leftJoin('users', 'users.id', '=', 'teachers.id')
73 73
                         ->orderBy('users.firstname', $columnDirection)->select('teachers.*');
74 74
                 },
75
-                'searchLogic' => function ($query, $column, $searchTerm) {
76
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
75
+                'searchLogic' => function($query, $column, $searchTerm) {
76
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
77 77
                         $q->where('firstname', 'like', '%'.$searchTerm.'%');
78 78
                     });
79 79
                 },
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
                 'attribute' => 'email', // foreign key attribute that is shown to user
88 88
                 'model'     => 'App\Models\User', // foreign key model
89 89
                 'orderable' => true,
90
-                'orderLogic' => function ($query, $column, $columnDirection) {
90
+                'orderLogic' => function($query, $column, $columnDirection) {
91 91
                     return $query->leftJoin('users', 'users.id', '=', 'teachers.id')
92 92
                         ->orderBy('users.email', $columnDirection)->select('teachers.*');
93 93
                 },
94
-                'searchLogic' => function ($query, $column, $searchTerm) {
95
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
94
+                'searchLogic' => function($query, $column, $searchTerm) {
95
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
96 96
                         $q->where('email', 'like', '%'.$searchTerm.'%');
97 97
                     });
98 98
                 },
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             $username = $request->email;
167 167
         }
168 168
         else {
169
-            $username = $this->generateUsername($request->firstname . ' ' . $request->lastname);
169
+            $username = $this->generateUsername($request->firstname.' '.$request->lastname);
170 170
         }
171 171
 
172 172
         $user = User::create([
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
         $username_parts = array_filter(explode(" ", strtolower($fullName)));
192 192
         $username_parts = array_slice($username_parts, -2);
193 193
 
194
-        $part1 = (!empty($username_parts[0]))?substr($username_parts[0], 0,3):"";
195
-        $part2 = (!empty($username_parts[1]))?substr($username_parts[1], 0,8):"";
194
+        $part1 = (!empty($username_parts[0])) ?substr($username_parts[0], 0, 3) : "";
195
+        $part2 = (!empty($username_parts[1])) ?substr($username_parts[1], 0, 8) : "";
196 196
         $part3 = rand(999, 9999);
197 197
 
198
-        $username = $part1. $part2. $part3; //str_shuffle to randomly shuffle all characters
198
+        $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters
199 199
 
200 200
         return $username;
201 201
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/SkillCrudController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     protected function setupListOperation()
34 34
     {
35 35
         CRUD::setColumns([
36
-            [ // skill type
36
+            [// skill type
37 37
                 'label'     => 'Type', // Table column heading
38 38
                 'type'      => 'select',
39 39
                 'name'      => 'skill_type', // the method that defines the relationship in your Model
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                 'type' => 'text',
47 47
                 'name' => 'name',
48 48
             ],
49
-            [ // skill level
49
+            [// skill level
50 50
                 'label'     => 'Level', // Table column heading
51 51
                 'type'      => 'select',
52 52
                 'name'      => 'level', // the method that defines the relationship in your Model
@@ -58,23 +58,23 @@  discard block
 block discarded – undo
58 58
 
59 59
         CRUD::enableBulkActions();
60 60
 
61
-        CRUD::addFilter([ // select2 filter
61
+        CRUD::addFilter([// select2 filter
62 62
             'name' => 'level_id',
63 63
             'type' => 'select2',
64 64
             'label'=> 'Level',
65
-        ], function () {
65
+        ], function() {
66 66
             return Level::all()->pluck('name', 'id')->toArray();
67
-        }, function ($value) { // if the filter is active
67
+        }, function($value) { // if the filter is active
68 68
             CRUD::addClause('where', 'level_id', $value);
69 69
         });
70 70
 
71
-        CRUD::addFilter([ // select2 filter
71
+        CRUD::addFilter([// select2 filter
72 72
             'name' => 'skill_type_id',
73 73
             'type' => 'select2',
74 74
             'label'=> 'Type',
75
-        ], function () {
75
+        ], function() {
76 76
             return SkillType::all()->pluck('name', 'id')->toArray();
77
-        }, function ($value) { // if the filter is active
77
+        }, function($value) { // if the filter is active
78 78
             CRUD::addClause('where', 'skill_type_id', $value);
79 79
         });
80 80
     }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         CRUD::setValidation(StoreRequest::class);
85 85
         CRUD::addFields([
86
-            [ // skill type
86
+            [// skill type
87 87
                 'label'     => 'Type', // Table column heading
88 88
                 'type' => 'select',
89 89
                 'name' => 'skill_type_id', // the db column for the foreign key
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                 'type' => 'text',
97 97
                 'name' => 'name',
98 98
             ],
99
-            [ // skill level
99
+            [// skill level
100 100
                 'label'     => 'Level', // Table column heading
101 101
                 'type' => 'select',
102 102
                 'name' => 'level_id', // the db column for the foreign key
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                 'type' => "relationship",
110 110
                 'name' => 'skill_type', // the method on your model that defines the relationship
111 111
                 'ajax' => true,
112
-                'inline_create' => [ // specify the entity in singular
112
+                'inline_create' => [// specify the entity in singular
113 113
                     'entity' => 'skilltype', // the entity in singular
114 114
                     // OPTIONALS
115 115
                     'force_select' => true, // should the inline-created entry be immediately selected?
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ConfigCrudController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     public function setup()
28 28
     {
29 29
         CRUD::setModel(\App\Models\Config::class);
30
-        CRUD::setRoute(config('backpack.base.route_prefix') . '/config');
30
+        CRUD::setRoute(config('backpack.base.route_prefix').'/config');
31 31
         CRUD::setEntityNameStrings('config', 'configs');
32 32
     }
33 33
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/InvoiceCrudController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function setup()
33 33
     {
34 34
         CRUD::setModel(\App\Models\Invoice::class);
35
-        CRUD::setRoute(config('backpack.base.route_prefix') . '/invoice');
35
+        CRUD::setRoute(config('backpack.base.route_prefix').'/invoice');
36 36
         CRUD::setEntityNameStrings('invoice', 'invoices');
37 37
         $this->crud->addButtonFromView('top', 'createInvoice', 'createInvoice', 'start');
38 38
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     {
102 102
         $invoice = Invoice::findOrFail($id)->load('payments');
103 103
 
104
-        if (! backpack_user()->can('enrollments.edit')) {
104
+        if (!backpack_user()->can('enrollments.edit')) {
105 105
             abort(403);
106 106
         }
107 107
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/StudentCrudController.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
                 'attribute' => 'lastname', // foreign key attribute that is shown to user
89 89
                 'model'     => 'App\Models\User', // foreign key model
90 90
                 'orderable' => true,
91
-                'orderLogic' => function ($query, $column, $columnDirection) {
91
+                'orderLogic' => function($query, $column, $columnDirection) {
92 92
                     return $query->leftJoin('users', 'users.id', '=', 'students.id')
93 93
                         ->orderBy('users.lastname', $columnDirection)->select('students.*');
94 94
                 },
95
-                'searchLogic' => function ($query, $column, $searchTerm) {
96
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
95
+                'searchLogic' => function($query, $column, $searchTerm) {
96
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
97 97
                         $q->where('lastname', 'like', '%'.$searchTerm.'%');
98 98
                     });
99 99
                 },
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
                 'attribute' => 'firstname', // foreign key attribute that is shown to user
109 109
                 'model'     => 'App\Models\User', // foreign key model
110 110
                 'orderable' => true,
111
-                'orderLogic' => function ($query, $column, $columnDirection) {
111
+                'orderLogic' => function($query, $column, $columnDirection) {
112 112
                     return $query->leftJoin('users', 'users.id', '=', 'students.id')
113 113
                         ->orderBy('users.firstname', $columnDirection)->select('students.*');
114 114
                 },
115
-                'searchLogic' => function ($query, $column, $searchTerm) {
116
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
115
+                'searchLogic' => function($query, $column, $searchTerm) {
116
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
117 117
                         $q->where('firstname', 'like', '%'.$searchTerm.'%');
118 118
                     });
119 119
                 },
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
                 'attribute' => 'email', // foreign key attribute that is shown to user
128 128
                 'model'     => 'App\Models\User', // foreign key model
129 129
                 'orderable' => true,
130
-                'orderLogic' => function ($query, $column, $columnDirection) {
130
+                'orderLogic' => function($query, $column, $columnDirection) {
131 131
                     return $query->leftJoin('users', 'users.id', '=', 'students.id')
132 132
                         ->orderBy('users.email', $columnDirection)->select('students.*');
133 133
                 },
134
-                'searchLogic' => function ($query, $column, $searchTerm) {
135
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
134
+                'searchLogic' => function($query, $column, $searchTerm) {
135
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
136 136
                         $q->where('email', 'like', '%'.$searchTerm.'%');
137 137
                     });
138 138
                 },
@@ -160,32 +160,32 @@  discard block
 block discarded – undo
160 160
 
161 161
         ]);
162 162
 
163
-        CRUD::addFilter([ // select2 filter
163
+        CRUD::addFilter([// select2 filter
164 164
             'name' => 'enrolled',
165 165
             'type' => 'select2',
166 166
             'label'=> __('Is Enrolled in'),
167
-        ], function () {
167
+        ], function() {
168 168
             return Period::all()->pluck('name', 'id')->toArray();
169
-        }, function ($value) { // if the filter is active
170
-            $this->crud->query = $this->crud->query->whereHas('enrollments', function ($query) use ($value) {
171
-                return $query->whereHas('course', function ($q) use ($value) {
169
+        }, function($value) { // if the filter is active
170
+            $this->crud->query = $this->crud->query->whereHas('enrollments', function($query) use ($value) {
171
+                return $query->whereHas('course', function($q) use ($value) {
172 172
                     $q->where('period_id', $value);
173 173
                 });
174 174
             });
175 175
         },
176
-          function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
176
+          function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
177 177
           });
178 178
 
179
-        CRUD::addFilter([ // select2_multiple filter
179
+        CRUD::addFilter([// select2_multiple filter
180 180
             'name' => 'notenrolled',
181 181
             'type' => 'select2_multiple',
182 182
             'label'=> __('Is Not Enrolled in'),
183
-        ], function () { // the options that show up in the select2
183
+        ], function() { // the options that show up in the select2
184 184
             return Period::all()->pluck('name', 'id')->toArray();
185
-        }, function ($values) { // if the filter is active
185
+        }, function($values) { // if the filter is active
186 186
             foreach (json_decode($values) as $value) {
187
-                $this->crud->query = $this->crud->query->whereDoesntHave('enrollments', function ($query) use ($value) {
188
-                    return $query->whereHas('course', function ($q) use ($value) {
187
+                $this->crud->query = $this->crud->query->whereDoesntHave('enrollments', function($query) use ($value) {
188
+                    return $query->whereHas('course', function($q) use ($value) {
189 189
                         $q->where('period_id', $value);
190 190
                     });
191 191
                 });
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
             'name'  => 'institution_id',
198 198
             'type'  => 'select2',
199 199
             'label' => __('Institution'),
200
-        ], function () {
200
+        ], function() {
201 201
             return Institution::all()->pluck('name', 'id')->toArray();
202
-        }, function ($value) { // if the filter is active
202
+        }, function($value) { // if the filter is active
203 203
             $this->crud->addClause('where', 'institution_id', $value);
204 204
         });
205 205
 
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
             'name'  => 'status_type_id',
208 208
             'type'  => 'select2',
209 209
             'label' => __('Lead Status'),
210
-        ], function () {
210
+        ], function() {
211 211
             return LeadType::all()->pluck('name', 'id')->toArray();
212
-        }, function ($value) {
212
+        }, function($value) {
213 213
             $this->crud->addClause('computedLeadType', $value);
214 214
         });
215 215
     }
@@ -300,11 +300,11 @@  discard block
 block discarded – undo
300 300
         $username_parts = array_filter(explode(" ", strtolower($fullName)));
301 301
         $username_parts = array_slice($username_parts, -2);
302 302
 
303
-        $part1 = (!empty($username_parts[0]))?substr($username_parts[0], 0,3):"";
304
-        $part2 = (!empty($username_parts[1]))?substr($username_parts[1], 0,8):"";
303
+        $part1 = (!empty($username_parts[0])) ?substr($username_parts[0], 0, 3) : "";
304
+        $part2 = (!empty($username_parts[1])) ?substr($username_parts[1], 0, 8) : "";
305 305
         $part3 = rand(999, 9999);
306 306
 
307
-        $username = $part1. $part2. $part3; //str_shuffle to randomly shuffle all characters
307
+        $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters
308 308
 
309 309
         return $username;
310 310
     }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
             $username = $request->email;
323 323
         }
324 324
         else {
325
-            $username = $this->generateUsername($request->firstname . ' ' . $request->lastname);
325
+            $username = $this->generateUsername($request->firstname.' '.$request->lastname);
326 326
         }
327 327
 
328 328
         // update the user info
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     {
392 392
         $student = Student::findOrFail($student);
393 393
 
394
-        if (! backpack_user()->isTeacher() && ! backpack_user()->can('enrollments.view')) {
394
+        if (!backpack_user()->isTeacher() && !backpack_user()->can('enrollments.view')) {
395 395
             abort(403);
396 396
         }
397 397
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ResultCrudController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
                 'type' => 'select',
49 49
                 'name' => 'student', // the method that defines the relationship in your Model
50 50
                 'attribute' => 'name', // foreign key attribute that is shown to user
51
-                'searchLogic' => function ($query, $column, $searchTerm) {
52
-                    $query->orWhereHas('student', function ($q) use ($searchTerm) {
53
-                        $q->WhereHas('user', function ($q) use ($searchTerm) {
51
+                'searchLogic' => function($query, $column, $searchTerm) {
52
+                    $query->orWhereHas('student', function($q) use ($searchTerm) {
53
+                        $q->WhereHas('user', function($q) use ($searchTerm) {
54 54
                             $q->where('firstname', 'like', '%'.$searchTerm.'%')
55 55
                             ->orWhere('lastname', 'like', '%'.$searchTerm.'%')
56 56
                             ->orWhere('email', 'like', '%'.$searchTerm.'%')
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             'label'=> __('No Result'),
90 90
         ],
91 91
           false,
92
-          function () {
92
+          function() {
93 93
               CRUD::addClause('noResult');
94 94
           }
95 95
         );
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             'label'=> __('Hide Parents'),
102 102
         ],
103 103
             false,
104
-            function () {
104
+            function() {
105 105
               CRUD::addClause('real');
106 106
           }
107 107
         );
@@ -110,20 +110,20 @@  discard block
 block discarded – undo
110 110
             'name' => 'period_id',
111 111
             'type' => 'select2',
112 112
             'label'=> __('Period'),
113
-        ], function () {
113
+        ], function() {
114 114
             return Period::all()->pluck('name', 'id')->toArray();
115
-        }, function ($value) { // if the filter is active
115
+        }, function($value) { // if the filter is active
116 116
             CRUD::addClause('period', $value);
117 117
         });
118 118
 
119
-        CRUD::addFilter([ // select2_multiple filter
119
+        CRUD::addFilter([// select2_multiple filter
120 120
             'name' => 'result',
121 121
             'type' => 'select2',
122 122
             'label'=> __('Result'),
123
-        ], function () { // the options that show up in the select2
123
+        ], function() { // the options that show up in the select2
124 124
             return ResultType::all()->pluck('name', 'id')->toArray();
125
-        }, function ($value) { // if the filter is active
126
-            $this->crud->query = $this->crud->query->whereHas('result', function ($query) use ($value) {
125
+        }, function($value) { // if the filter is active
126
+            $this->crud->query = $this->crud->query->whereHas('result', function($query) use ($value) {
127 127
                 $query->where('result_type_id', $value);
128 128
             });
129 129
         });
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ExternalCourseCrudController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -158,66 +158,66 @@  discard block
 block discarded – undo
158 158
         ]);
159 159
 
160 160
         CRUD::addFilter(
161
-            [ // select2 filter
161
+            [// select2 filter
162 162
             'name' => 'rhythm_id',
163 163
             'type' => 'select2',
164 164
             'label'=> __('Rhythm'),
165 165
         ],
166
-            function () {
166
+            function() {
167 167
             return \App\Models\Rhythm::all()->pluck('name', 'id')->toArray();
168 168
         },
169
-            function ($value) { // if the filter is active
169
+            function($value) { // if the filter is active
170 170
             CRUD::addClause('where', 'rhythm_id', $value);
171 171
         },
172
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
172
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
173 173
           }
174 174
         );
175 175
 
176 176
         CRUD::addFilter(
177
-            [ // select2 filter
177
+            [// select2 filter
178 178
             'name' => 'teacher_id',
179 179
             'type' => 'select2',
180 180
             'label'=> __('Teacher'),
181 181
         ],
182
-            function () {
182
+            function() {
183 183
             return \App\Models\Teacher::all()->pluck('name', 'id')->toArray();
184 184
         },
185
-            function ($value) { // if the filter is active
185
+            function($value) { // if the filter is active
186 186
             CRUD::addClause('where', 'teacher_id', $value);
187 187
         },
188
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
188
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
189 189
           }
190 190
         );
191 191
 
192 192
         CRUD::addFilter(
193
-            [ // select2 filter
193
+            [// select2 filter
194 194
             'name' => 'level_id',
195 195
             'type' => 'select2',
196 196
             'label'=> __('Level'),
197 197
         ],
198
-            function () {
198
+            function() {
199 199
             return \App\Models\Level::all()->pluck('name', 'id')->toArray();
200 200
         },
201
-            function ($value) { // if the filter is active
201
+            function($value) { // if the filter is active
202 202
             CRUD::addClause('where', 'level_id', $value);
203 203
         },
204
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
204
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
205 205
           }
206 206
         );
207 207
 
208 208
         CRUD::addFilter(
209
-            [ // select2 filter
209
+            [// select2 filter
210 210
             'name' => 'period_id',
211 211
             'type' => 'select2',
212 212
             'label'=> __('Period'),
213 213
         ],
214
-            function () {
214
+            function() {
215 215
             return Period::all()->pluck('name', 'id')->toArray();
216 216
         },
217
-            function ($value) { // if the filter is active
217
+            function($value) { // if the filter is active
218 218
             CRUD::addClause('where', 'period_id', $value);
219 219
         },
220
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
220
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
221 221
               $period = Period::get_default_period()->id;
222 222
               CRUD::addClause('where', 'period_id', $period);
223 223
               $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
                 'tab' => __('Course info'),
364 364
             ],
365 365
 
366
-            [   // repeatable
366
+            [// repeatable
367 367
                 'name'  => 'times',
368 368
                 'label' => __('Course Schedule'),
369 369
                 'type'  => 'repeatable',
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
                 'tab' => __('Schedule'),
403 403
             ],
404 404
 
405
-            [   // view
405
+            [// view
406 406
                 'name' => 'custom-ajax-button',
407 407
                 'type' => 'view',
408 408
                 'view' => 'courses/schedule-preset-alert',
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
                 'tab' => __('Course info'),
557 557
             ],
558 558
 
559
-            [   // repeatable
559
+            [// repeatable
560 560
                 'name'  => 'times',
561 561
                 'label' => __('Course Schedule'),
562 562
                 'type'  => 'repeatable',
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/EvaluationTypeCrudController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         CRUD::addField(['name' => 'name', 'label' => 'Name', 'type' => 'text']);
37 37
 
38
-        CRUD::addField([    // Select2Multiple = n-n relationship (with pivot table)
38
+        CRUD::addField([// Select2Multiple = n-n relationship (with pivot table)
39 39
             'label'     => __('Grade Types'),
40 40
             'type'      => 'select2_multiple',
41 41
             'name'      => 'gradeTypes', // the method that defines the relationship in your Model
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             'select_all' => true, // show Select All and Clear buttons?
49 49
         ]);
50 50
 
51
-        CRUD::addField([    // Select2Multiple = n-n relationship (with pivot table)
51
+        CRUD::addField([// Select2Multiple = n-n relationship (with pivot table)
52 52
             'label'     => __('Skills'),
53 53
             'type'      => 'select2_multiple',
54 54
             'name'      => 'skills', // the method that defines the relationship in your Model
Please login to merge, or discard this patch.