Passed
Push — master ( 6e44a2...3e59ed )
by Thomas
08:38
created
app/Http/Controllers/Admin/EventCrudController.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -116,39 +116,39 @@  discard block
 block discarded – undo
116 116
             'name' => 'from_to',
117 117
             'label'=> __('Date range'),
118 118
         ],
119
-          false,
120
-          function ($value) { // if the filter is active, apply these constraints
121
-              $dates = json_decode($value, null, 512, JSON_THROW_ON_ERROR);
122
-
123
-              if ($dates->from) {
124
-                  CRUD::addClause('where', 'start', '>=', $dates->from);
125
-              }
126
-              if ($dates->to) {
127
-                  CRUD::addClause('where', 'start', '<=', $dates->to.' 23:59:59');
128
-              }
129
-          });
119
+            false,
120
+            function ($value) { // if the filter is active, apply these constraints
121
+                $dates = json_decode($value, null, 512, JSON_THROW_ON_ERROR);
122
+
123
+                if ($dates->from) {
124
+                    CRUD::addClause('where', 'start', '>=', $dates->from);
125
+                }
126
+                if ($dates->to) {
127
+                    CRUD::addClause('where', 'start', '<=', $dates->to.' 23:59:59');
128
+                }
129
+            });
130 130
 
131 131
         CRUD::addFilter([
132 132
             'type' => 'simple',
133 133
             'name' => 'orphan',
134 134
             'label'=> __('Events with no course'),
135 135
         ],
136
-          false,
137
-          function ($value) { // if the filter is active, apply these constraints
138
-              $this->crud->query->where('course_id', null);
139
-          },
140
-          function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
141
-          });
136
+            false,
137
+            function ($value) { // if the filter is active, apply these constraints
138
+                $this->crud->query->where('course_id', null);
139
+            },
140
+            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
141
+            });
142 142
 
143 143
         CRUD::addFilter([
144 144
             'type' => 'simple',
145 145
             'name' => 'unassigned',
146 146
             'label'=> __('Events with no teacher'),
147 147
         ],
148
-          false,
149
-          function ($value) { // if the filter is active, apply these constraints
150
-              CRUD::addClause('unassigned');
151
-          });
148
+            false,
149
+            function ($value) { // if the filter is active, apply these constraints
150
+                CRUD::addClause('unassigned');
151
+            });
152 152
 
153 153
         CRUD::addFilter([ // select2 filter
154 154
             'name' => 'teacher_id',
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
         ], fn () => Teacher::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active
158 158
             CRUD::addClause('where', 'teacher_id', $value);
159 159
         },
160
-          function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
161
-          });
160
+            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
161
+            });
162 162
     }
163 163
 
164 164
     public function store(Request $request)
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
 
112 112
         ]);
113 113
 
114
-        CRUD::addFilter([ // daterange filter
114
+        CRUD::addFilter([// daterange filter
115 115
             'type' => 'date_range',
116 116
             'name' => 'from_to',
117 117
             'label'=> __('Date range'),
118 118
         ],
119 119
           false,
120
-          function ($value) { // if the filter is active, apply these constraints
120
+          function($value) { // if the filter is active, apply these constraints
121 121
               $dates = json_decode($value, null, 512, JSON_THROW_ON_ERROR);
122 122
 
123 123
               if ($dates->from) {
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
             'label'=> __('Events with no course'),
135 135
         ],
136 136
           false,
137
-          function ($value) { // if the filter is active, apply these constraints
137
+          function($value) { // if the filter is active, apply these constraints
138 138
               $this->crud->query->where('course_id', null);
139 139
           },
140
-          function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
140
+          function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
141 141
           });
142 142
 
143 143
         CRUD::addFilter([
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
             'label'=> __('Events with no teacher'),
147 147
         ],
148 148
           false,
149
-          function ($value) { // if the filter is active, apply these constraints
149
+          function($value) { // if the filter is active, apply these constraints
150 150
               CRUD::addClause('unassigned');
151 151
           });
152 152
 
153
-        CRUD::addFilter([ // select2 filter
153
+        CRUD::addFilter([// select2 filter
154 154
             'name' => 'teacher_id',
155 155
             'type' => 'select2',
156 156
             'label'=> __('Teacher'),
157
-        ], fn () => Teacher::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active
157
+        ], fn() => Teacher::all()->pluck('name', 'id')->toArray(), function($value) { // if the filter is active
158 158
             CRUD::addClause('where', 'teacher_id', $value);
159 159
         },
160
-          function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
160
+          function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
161 161
           });
162 162
     }
163 163
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ResultCrudController.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                             $q->where('firstname', 'like', '%'.$searchTerm.'%')
59 59
                             ->orWhere('lastname', 'like', '%'.$searchTerm.'%')
60 60
                             ->orWhere('email', 'like', '%'.$searchTerm.'%')
61
-                          ->orWhere('idnumber', 'like', '%'.$searchTerm.'%');
61
+                            ->orWhere('idnumber', 'like', '%'.$searchTerm.'%');
62 62
                         });
63 63
                     });
64 64
                 },
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
             'name' => 'noresult',
93 93
             'label'=> __('No Result'),
94 94
         ],
95
-          false,
96
-          function () {
97
-              CRUD::addClause('noResult');
98
-          }
95
+            false,
96
+            function () {
97
+                CRUD::addClause('noResult');
98
+            }
99 99
         );
100 100
 
101 101
         CRUD::addFilter(
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
                 'type' => 'select',
53 53
                 'name' => 'student',
54 54
                 'attribute' => 'name',
55
-                'searchLogic' => function ($query, $column, $searchTerm) {
56
-                    $query->orWhereHas('student', function ($q) use ($searchTerm) {
57
-                        $q->WhereHas('user', function ($q) use ($searchTerm) {
55
+                'searchLogic' => function($query, $column, $searchTerm) {
56
+                    $query->orWhereHas('student', function($q) use ($searchTerm) {
57
+                        $q->WhereHas('user', function($q) use ($searchTerm) {
58 58
                             $q->where('firstname', 'like', '%'.$searchTerm.'%')
59 59
                             ->orWhere('lastname', 'like', '%'.$searchTerm.'%')
60 60
                             ->orWhere('email', 'like', '%'.$searchTerm.'%')
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             'label'=> __('No Result'),
94 94
         ],
95 95
           false,
96
-          function () {
96
+          function() {
97 97
               CRUD::addClause('noResult');
98 98
           }
99 99
         );
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                 'label'=> __('Hide Parents'),
106 106
             ],
107 107
             false,
108
-            function () {
108
+            function() {
109 109
                 CRUD::addClause('real');
110 110
             }
111 111
         );
@@ -114,16 +114,16 @@  discard block
 block discarded – undo
114 114
             'name' => 'period_id',
115 115
             'type' => 'select2',
116 116
             'label'=> __('Period'),
117
-        ], fn () => Period::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active
117
+        ], fn() => Period::all()->pluck('name', 'id')->toArray(), function($value) { // if the filter is active
118 118
             CRUD::addClause('period', $value);
119 119
         });
120 120
 
121
-        CRUD::addFilter([ // select2_multiple filter
121
+        CRUD::addFilter([// select2_multiple filter
122 122
             'name' => 'result',
123 123
             'type' => 'select2',
124 124
             'label'=> __('Result'),
125
-        ], fn () => ResultType::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active
126
-            $this->crud->query = $this->crud->query->whereHas('result', function ($query) use ($value) {
125
+        ], fn() => ResultType::all()->pluck('name', 'id')->toArray(), 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/StudentCrudController.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -184,8 +184,8 @@
 block discarded – undo
184 184
                 $q->where('period_id', $value);
185 185
             }));
186 186
         },
187
-          function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
188
-          });
187
+            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
188
+            });
189 189
 
190 190
         CRUD::addFilter([ // select2_multiple filter
191 191
             'name' => 'notenrolled',
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
                 'attribute' => 'lastname',
92 92
                 'model'     => \App\Models\User::class,
93 93
                 'orderable' => true,
94
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
94
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
95 95
                     ->orderBy('users.lastname', $columnDirection)->select('students.*'),
96
-                'searchLogic' => function ($query, $column, $searchTerm) {
97
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
96
+                'searchLogic' => function($query, $column, $searchTerm) {
97
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
98 98
                         $q->where('lastname', 'like', '%'.$searchTerm.'%');
99 99
                     });
100 100
                 },
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
                 'attribute' => 'firstname',
110 110
                 'model'     => \App\Models\User::class,
111 111
                 'orderable' => true,
112
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
112
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
113 113
                     ->orderBy('users.firstname', $columnDirection)->select('students.*'),
114
-                'searchLogic' => function ($query, $column, $searchTerm) {
115
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
114
+                'searchLogic' => function($query, $column, $searchTerm) {
115
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
116 116
                         $q->where('firstname', 'like', '%'.$searchTerm.'%');
117 117
                     });
118 118
                 },
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
                 'attribute' => 'email',
127 127
                 'model'     => \App\Models\User::class,
128 128
                 'orderable' => true,
129
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
129
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
130 130
                     ->orderBy('users.email', $columnDirection)->select('students.*'),
131
-                'searchLogic' => function ($query, $column, $searchTerm) {
132
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
131
+                'searchLogic' => function($query, $column, $searchTerm) {
132
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
133 133
                         $q->where('email', 'like', '%'.$searchTerm.'%');
134 134
                     });
135 135
                 },
@@ -175,25 +175,25 @@  discard block
 block discarded – undo
175 175
 
176 176
         ]);
177 177
 
178
-        CRUD::addFilter([ // select2 filter
178
+        CRUD::addFilter([// select2 filter
179 179
             'name' => 'enrolled',
180 180
             'type' => 'select2',
181 181
             'label'=> __('Is Enrolled in'),
182
-        ], fn () => Period::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active
183
-            $this->crud->query = $this->crud->query->whereHas('enrollments', fn ($query) => $query->whereHas('course', function ($q) use ($value) {
182
+        ], fn() => Period::all()->pluck('name', 'id')->toArray(), function($value) { // if the filter is active
183
+            $this->crud->query = $this->crud->query->whereHas('enrollments', fn($query) => $query->whereHas('course', function($q) use ($value) {
184 184
                 $q->where('period_id', $value);
185 185
             }));
186 186
         },
187
-          function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
187
+          function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
188 188
           });
189 189
 
190
-        CRUD::addFilter([ // select2_multiple filter
190
+        CRUD::addFilter([// select2_multiple filter
191 191
             'name' => 'notenrolled',
192 192
             'type' => 'select2_multiple',
193 193
             'label'=> __('Is Not Enrolled in'),
194
-        ], fn () => Period::all()->pluck('name', 'id')->toArray(), function ($values) { // if the filter is active
194
+        ], fn() => Period::all()->pluck('name', 'id')->toArray(), function($values) { // if the filter is active
195 195
             foreach (json_decode($values, null, 512, JSON_THROW_ON_ERROR) as $value) {
196
-                $this->crud->query = $this->crud->query->whereDoesntHave('enrollments', fn ($query) => $query->whereHas('course', function ($q) use ($value) {
196
+                $this->crud->query = $this->crud->query->whereDoesntHave('enrollments', fn($query) => $query->whereHas('course', function($q) use ($value) {
197 197
                     $q->where('period_id', $value);
198 198
                 }));
199 199
             }
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
             'type' => 'select2',
205 205
             'label'=> __('New In'),
206 206
         ],
207
-            fn () => Period::all()->pluck('name', 'id')->toArray(),
208
-            function ($value) { // if the filter is active
207
+            fn() => Period::all()->pluck('name', 'id')->toArray(),
208
+            function($value) { // if the filter is active
209 209
                 CRUD::addClause('newInPeriod', $value);
210 210
             }
211 211
         );
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             'name'  => 'institution_id',
216 216
             'type'  => 'select2',
217 217
             'label' => __('Institution'),
218
-        ], fn () => Institution::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active
218
+        ], fn() => Institution::all()->pluck('name', 'id')->toArray(), function($value) { // if the filter is active
219 219
             $this->crud->addClause('where', 'institution_id', $value);
220 220
         });
221 221
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
             'name'  => 'status_type_id',
224 224
             'type'  => 'select2',
225 225
             'label' => __('Lead Status'),
226
-        ], fn () => LeadType::all()->pluck('name', 'id')->toArray(), function ($value) {
226
+        ], fn() => LeadType::all()->pluck('name', 'id')->toArray(), function($value) {
227 227
             if ($value === '4') {
228 228
                 $this->crud->query = $this->crud->query->where('lead_type_id', $value)->orWhere('lead_type_id', null);
229 229
             } else {
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
         $username_parts = array_filter(explode(' ', strtolower($fullName)));
340 340
         $username_parts = array_slice($username_parts, -2);
341 341
 
342
-        $part1 = (! empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
343
-        $part2 = (! empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
342
+        $part1 = (!empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
343
+        $part2 = (!empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
344 344
         $part3 = random_int(999, 9999);
345 345
 
346 346
         $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
     {
429 429
         $student = Student::findOrFail($student);
430 430
 
431
-        if (! backpack_user()->isTeacher() && ! backpack_user()->can('enrollments.view')) {
431
+        if (!backpack_user()->isTeacher() && !backpack_user()->can('enrollments.view')) {
432 432
             abort(403);
433 433
         }
434 434
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/PaymentCrudController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             'label' => __('Due Date'),
50 50
         ],
51 51
             false,
52
-            function ($value) { // if the filter is active, apply these constraints
52
+            function($value) { // if the filter is active, apply these constraints
53 53
                 $this->crud->addClause('where', 'date', '>=', Carbon::parse($value)->firstOfMonth());
54 54
                 $this->crud->addClause('where', 'date', '<=', Carbon::parse($value)->lastOfMonth());
55 55
             });
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $payment = Payment::findOrFail($id);
92 92
 
93
-        if (! backpack_user()->can('enrollments.edit')) {
93
+        if (!backpack_user()->can('enrollments.edit')) {
94 94
             abort(403);
95 95
         }
96 96
 
97
-        if (! $payment->invoice) {
97
+        if (!$payment->invoice) {
98 98
             abort(404, 'No enrollment found for this payment');
99 99
         }
100 100
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/CourseCrudController.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         CRUD::addClause('internal');
55 55
         $permissions = backpack_user()->getAllPermissions();
56 56
 
57
-        if (! $permissions->contains('name', 'courses.edit')) {
57
+        if (!$permissions->contains('name', 'courses.edit')) {
58 58
             CRUD::denyAccess(['update', 'create']);
59 59
         }
60 60
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
         CRUD::addButtonFromView('line', 'children_badge', 'children_badge', 'beginning');
66 66
 
67
-        if (! $permissions->contains('name', 'courses.delete')) {
67
+        if (!$permissions->contains('name', 'courses.delete')) {
68 68
             CRUD::denyAccess(['delete']);
69 69
         }
70 70
 
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
             'name' => 'rhythm_id',
187 187
             'type' => 'select2',
188 188
             'label'=> __('Rhythm'),
189
-        ], fn () => Rhythm::all()->pluck('name', 'id')->toArray(), function ($value) {
189
+        ], fn() => Rhythm::all()->pluck('name', 'id')->toArray(), function($value) {
190 190
             // if the filter is active
191 191
             CRUD::addClause('where', 'rhythm_id', $value);
192 192
         },
193
-        function () {
193
+        function() {
194 194
             // if the filter is NOT active (the GET parameter "checkbox" does not exit)
195 195
         });
196 196
 
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
             'name' => 'teacher_id',
199 199
             'type' => 'select2',
200 200
             'label'=> __('Teacher'),
201
-        ], fn () => Teacher::all()->pluck('name', 'id')->toArray(), function ($value) {
201
+        ], fn() => Teacher::all()->pluck('name', 'id')->toArray(), function($value) {
202 202
             // if the filter is active
203 203
             CRUD::addClause('where', 'teacher_id', $value);
204 204
         },
205
-        function () {
205
+        function() {
206 206
             // if the filter is NOT active (the GET parameter "checkbox" does not exit)
207 207
         });
208 208
 
@@ -210,11 +210,11 @@  discard block
 block discarded – undo
210 210
             'name' => 'level_id',
211 211
             'type' => 'select2',
212 212
             'label'=> __('Level'),
213
-        ], fn () => Level::all()->pluck('name', 'id')->toArray(), function ($value) {
213
+        ], fn() => Level::all()->pluck('name', 'id')->toArray(), function($value) {
214 214
             // if the filter is active
215 215
             CRUD::addClause('where', 'level_id', $value);
216 216
         },
217
-        function () {
217
+        function() {
218 218
             // if the filter is NOT active (the GET parameter "checkbox" does not exit)
219 219
         });
220 220
 
@@ -223,11 +223,11 @@  discard block
 block discarded – undo
223 223
             'type' => 'select2',
224 224
             'label'=> __('Period'),
225 225
         ],
226
-            fn () => \App\Models\Period::all()->sortByDesc('id')->pluck('name', 'id')->toArray(),
227
-            function ($value) { // if the filter is active
226
+            fn() => \App\Models\Period::all()->sortByDesc('id')->pluck('name', 'id')->toArray(),
227
+            function($value) { // if the filter is active
228 228
                 CRUD::addClause('where', 'period_id', $value);
229 229
             },
230
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
230
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
231 231
                 $period = \App\Models\Period::get_default_period()->id;
232 232
                 CRUD::addClause('where', 'period_id', $period);
233 233
                 $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active
@@ -235,13 +235,13 @@  discard block
 block discarded – undo
235 235
         );
236 236
 
237 237
         CRUD::addFilter(
238
-            [ // add a "simple" filter called Draft
238
+            [// add a "simple" filter called Draft
239 239
                 'type' => 'simple',
240 240
                 'name' => 'parent',
241 241
                 'label'=> __('Hide Children Courses'),
242 242
             ],
243 243
             false,
244
-            function () {
244
+            function() {
245 245
                 CRUD::addClause('parent');
246 246
             }
247 247
         );
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
             'label' => __('Start'),
253 253
         ],
254 254
             false,
255
-            function ($value) { // if the filter is active, apply these constraints
255
+            function($value) { // if the filter is active, apply these constraints
256 256
                 $dates = json_decode($value, null, 512, JSON_THROW_ON_ERROR);
257 257
                 $this->crud->addClause('where', 'start_date', '>=', $dates->from);
258 258
                 $this->crud->addClause('where', 'start_date', '<=', $dates->to.' 23:59:59');
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             'label' => __('End'),
265 265
         ],
266 266
             false,
267
-            function ($value) { // if the filter is active, apply these constraints
267
+            function($value) { // if the filter is active, apply these constraints
268 268
                 $dates = json_decode($value, null, 512, JSON_THROW_ON_ERROR);
269 269
                 $this->crud->addClause('where', 'end_date', '>=', $dates->from);
270 270
                 $this->crud->addClause('where', 'end_date', '<=', $dates->to.' 23:59:59');
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                 'tab' => __('Course info'),
361 361
             ],
362 362
 
363
-            [   // repeatable
363
+            [// repeatable
364 364
                 'name'  => 'sublevels',
365 365
                 'label' => __('Course sublevels'),
366 366
                 'type'  => 'repeatable',
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                 'default' => Period::get_enrollments_period()->end,
518 518
             ],
519 519
 
520
-            [   // repeatable
520
+            [// repeatable
521 521
                 'name'  => 'times',
522 522
                 'label' => __('Course Schedule'),
523 523
                 'type'  => 'repeatable',
@@ -580,14 +580,14 @@  discard block
 block discarded – undo
580 580
                 'init_rows' => 0, // number of empty rows to be initialized, by default 1
581 581
             ],
582 582
 
583
-            [   // view
583
+            [// view
584 584
                 'name' => 'custom-ajax-button',
585 585
                 'type' => 'view',
586 586
                 'view' => 'courses/schedule-preset-alert',
587 587
                 'tab' => __('Schedule'),
588 588
             ],
589 589
 
590
-            [   // select_from_array
590
+            [// select_from_array
591 591
                 'name'        => 'schedulepreset',
592 592
                 'label'       => __('Schedule Preset'),
593 593
                 'type'        => 'select_from_array',
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
         }
612 612
 
613 613
         if ($this->crud->getCurrentEntry()->children->count() > 0) {
614
-            CRUD::addField([   // view
614
+            CRUD::addField([// view
615 615
                 'name' => 'custom-ajax-button',
616 616
                 'type' => 'view',
617 617
                 'view' => 'courses/parent-course-alert',
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
         }
620 620
 
621 621
         if ($this->crud->getCurrentEntry()->parent_course_id !== null) {
622
-            CRUD::addField([   // view
622
+            CRUD::addField([// view
623 623
                 'name' => 'custom-ajax-button',
624 624
                 'type' => 'view',
625 625
                 'view' => 'courses/child-course-alert',
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
@@ -168,58 +168,58 @@  discard block
 block discarded – undo
168 168
         ]);
169 169
 
170 170
         CRUD::addFilter(
171
-            [ // select2 filter
171
+            [// select2 filter
172 172
                 'name' => 'rhythm_id',
173 173
                 'type' => 'select2',
174 174
                 'label'=> __('Rhythm'),
175 175
             ],
176
-            fn () => Rhythm::all()->pluck('name', 'id')->toArray(),
177
-            function ($value) { // if the filter is active
176
+            fn() => Rhythm::all()->pluck('name', 'id')->toArray(),
177
+            function($value) { // if the filter is active
178 178
                 CRUD::addClause('where', 'rhythm_id', $value);
179 179
             },
180
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
180
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
181 181
             }
182 182
         );
183 183
 
184 184
         CRUD::addFilter(
185
-            [ // select2 filter
185
+            [// select2 filter
186 186
                 'name' => 'teacher_id',
187 187
                 'type' => 'select2',
188 188
                 'label'=> __('Teacher'),
189 189
             ],
190
-            fn () => Teacher::all()->pluck('name', 'id')->toArray(),
191
-            function ($value) { // if the filter is active
190
+            fn() => Teacher::all()->pluck('name', 'id')->toArray(),
191
+            function($value) { // if the filter is active
192 192
                 CRUD::addClause('where', 'teacher_id', $value);
193 193
             },
194
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
194
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
195 195
             }
196 196
         );
197 197
 
198 198
         CRUD::addFilter(
199
-            [ // select2 filter
199
+            [// select2 filter
200 200
                 'name' => 'level_id',
201 201
                 'type' => 'select2',
202 202
                 'label'=> __('Level'),
203 203
             ],
204
-            fn () => Level::all()->pluck('name', 'id')->toArray(),
205
-            function ($value) { // if the filter is active
204
+            fn() => Level::all()->pluck('name', 'id')->toArray(),
205
+            function($value) { // if the filter is active
206 206
                 CRUD::addClause('where', 'level_id', $value);
207 207
             },
208
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
208
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
209 209
             }
210 210
         );
211 211
 
212 212
         CRUD::addFilter(
213
-            [ // select2 filter
213
+            [// select2 filter
214 214
                 'name' => 'period_id',
215 215
                 'type' => 'select2',
216 216
                 'label'=> __('Period'),
217 217
             ],
218
-            fn () => Period::all()->pluck('name', 'id')->toArray(),
219
-            function ($value) { // if the filter is active
218
+            fn() => Period::all()->pluck('name', 'id')->toArray(),
219
+            function($value) { // if the filter is active
220 220
                 CRUD::addClause('where', 'period_id', $value);
221 221
             },
222
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
222
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
223 223
                 $period = Period::get_default_period()->id;
224 224
                 CRUD::addClause('where', 'period_id', $period);
225 225
                 $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
                 'tab' => __('Course info'),
366 366
             ],
367 367
 
368
-            [   // repeatable
368
+            [// repeatable
369 369
                 'name'  => 'times',
370 370
                 'label' => __('Course Schedule'),
371 371
                 'type'  => 'repeatable',
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                 'tab' => __('Schedule'),
405 405
             ],
406 406
 
407
-            [   // view
407
+            [// view
408 408
                 'name' => 'custom-ajax-button',
409 409
                 'type' => 'view',
410 410
                 'view' => 'courses/schedule-preset-alert',
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
                 'tab' => __('Course info'),
559 559
             ],
560 560
 
561
-            [   // repeatable
561
+            [// repeatable
562 562
                 'name'  => 'times',
563 563
                 'label' => __('Course Schedule'),
564 564
                 'type'  => 'repeatable',
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ScheduledPaymentCrudController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
             'attribute' => 'lastname',
44 44
             'label' => __('Last Name'),
45 45
             'type' => 'relationship',
46
-            'searchLogic' => function ($query, $column, $searchTerm) {
47
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
48
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
46
+            'searchLogic' => function($query, $column, $searchTerm) {
47
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
48
+                    $q->whereHas('user', function($q) use ($searchTerm) {
49 49
                         $q->where('lastname', 'like', '%'.$searchTerm.'%');
50 50
                     });
51 51
                 });
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
             'attribute' => 'firstname',
59 59
             'label' => __('First Name'),
60 60
             'type' => 'relationship',
61
-            'searchLogic' => function ($query, $column, $searchTerm) {
62
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
63
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
61
+            'searchLogic' => function($query, $column, $searchTerm) {
62
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
63
+                    $q->whereHas('user', function($q) use ($searchTerm) {
64 64
                         $q->where('firstname', 'like', '%'.$searchTerm.'%');
65 65
                     });
66 66
                 });
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
             'attribute' => 'email',
74 74
             'label' => __('Email'),
75 75
             'type' => 'relationship',
76
-            'searchLogic' => function ($query, $column, $searchTerm) {
77
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
78
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
76
+            'searchLogic' => function($query, $column, $searchTerm) {
77
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
78
+                    $q->whereHas('user', function($q) use ($searchTerm) {
79 79
                         $q->where('email', 'like', '%'.$searchTerm.'%');
80 80
                     });
81 81
                 });
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
             'name' => 'status_id',
106 106
             'type' => 'select2',
107 107
             'label'=> __('Status'),
108
-        ], fn () => [
108
+        ], fn() => [
109 109
             1 => __('Pending'),
110 110
             2 => __('Paid'),
111 111
         ],
112
-            function ($value) { // if the filter is active
112
+            function($value) { // if the filter is active
113 113
                 CRUD::addClause('status', $value);
114 114
             });
115 115
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -166,9 +166,9 @@
 block discarded – undo
166 166
         // add photo
167 167
         if ($request->data['userPicture']) {
168 168
             $student
169
-               ->addMediaFromBase64($request->data['userPicture'])
170
-               ->usingFileName('profilePicture.jpg')
171
-               ->toMediaCollection('profile-picture');
169
+                ->addMediaFromBase64($request->data['userPicture'])
170
+                ->usingFileName('profilePicture.jpg')
171
+                ->toMediaCollection('profile-picture');
172 172
 
173 173
             Log::info('Profile picture added to the student profile');
174 174
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
         $username_parts = array_filter(explode(' ', strtolower($fullName)));
31 31
         $username_parts = array_slice($username_parts, -2);
32 32
 
33
-        $part1 = (! empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
34
-        $part2 = (! empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
33
+        $part1 = (!empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
34
+        $part2 = (!empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
35 35
         $part3 = random_int(999, 9999);
36 36
 
37 37
         $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     {
122 122
 
123 123
         // if registration is closed, deny access
124
-        if (! config('backpack.base.registration_open')) {
124
+        if (!config('backpack.base.registration_open')) {
125 125
             abort(403, trans('backpack::base.registration_closed'));
126 126
         }
127 127
 
Please login to merge, or discard this patch.
app/Http/Controllers/BookController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $angle = 0;
72 72
         $width = imagesx($image);
73 73
         $centerX = $width / 2;
74
-        [$left, , $right] = imageftbbox($font_size, $angle, $font, $text);
74
+        [$left,, $right] = imageftbbox($font_size, $angle, $font, $text);
75 75
         $left_offset = ($right - $left) / 2;
76 76
         $x = $centerX - $left_offset;
77 77
         imagettftext($image, $font_size, $angle, $x, 450, $black, $font, $text);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $angle = 0;
82 82
         $width = imagesx($image);
83 83
         $centerX = $width / 2;
84
-        [$left, , $right] = imageftbbox($font_size, $angle, $font, $text);
84
+        [$left,, $right] = imageftbbox($font_size, $angle, $font, $text);
85 85
         $left_offset = ($right - $left) / 2;
86 86
         $x = $centerX - $left_offset;
87 87
         imagettftext($image, $font_size, $angle, $x, 525, $black, $font, $text);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $angle = 0;
92 92
         $width = imagesx($image);
93 93
         $centerX = $width / 2;
94
-        [$left, , $right] = imageftbbox($font_size, $angle, $font, $text);
94
+        [$left,, $right] = imageftbbox($font_size, $angle, $font, $text);
95 95
         $left_offset = ($right - $left) / 2;
96 96
         $x = $centerX - $left_offset;
97 97
         imagettftext($image, $font_size, $angle, $x, 620, $black, $font, $text);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $angle = 0;
102 102
         $width = imagesx($image);
103 103
         $centerX = $width / 2;
104
-        [$left, , $right] = imageftbbox($font_size, $angle, $font, $text);
104
+        [$left,, $right] = imageftbbox($font_size, $angle, $font, $text);
105 105
         $left_offset = ($right - $left) / 2;
106 106
         $x = $centerX - $left_offset;
107 107
         imagettftext($image, $font_size, $angle, $x, 690, $black, $font, $text);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         $angle = 0;
115 115
         $width = imagesx($image);
116 116
         $centerX = $width / 2;
117
-        [$left, , $right] = imageftbbox($font_size, $angle, $font, $text);
117
+        [$left,, $right] = imageftbbox($font_size, $angle, $font, $text);
118 118
         $left_offset = ($right - $left) / 2;
119 119
         $x = $centerX - $left_offset;
120 120
         imagettftext($image, $font_size, $angle, $x, 755, $black, $font, $text);
Please login to merge, or discard this patch.