Passed
Push — master ( 49a2c9...58d635 )
by Thomas
07:31
created
app/Events/LeadStatusUpdatedEvent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     public $lastname;
22 22
 
23
-    public function __construct(Student|Contact $user, public $listId)
23
+    public function __construct(Student | Contact $user, public $listId)
24 24
     {
25 25
         $this->email = $user->email;
26 26
         $this->name = $user->firstname;
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/StudentCrudController.php 1 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', // foreign key attribute that is shown to user
92 92
                 'model'     => \App\Models\User::class, // foreign key model
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', // foreign key attribute that is shown to user
110 110
                 'model'     => \App\Models\User::class, // foreign key model
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', // foreign key attribute that is shown to user
127 127
                 'model'     => \App\Models\User::class, // foreign key model
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 {
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
         $username_parts = array_filter(explode(' ', strtolower($fullName)));
319 319
         $username_parts = array_slice($username_parts, -2);
320 320
 
321
-        $part1 = (! empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
322
-        $part2 = (! empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
321
+        $part1 = (!empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
322
+        $part2 = (!empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
323 323
         $part3 = random_int(999, 9999);
324 324
 
325 325
         $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
     {
408 408
         $student = Student::findOrFail($student);
409 409
 
410
-        if (! backpack_user()->isTeacher() && ! backpack_user()->can('enrollments.view')) {
410
+        if (!backpack_user()->isTeacher() && !backpack_user()->can('enrollments.view')) {
411 411
             abort(403);
412 412
         }
413 413
 
Please login to merge, or discard this patch.
app/Models/Enrollment.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
     public function scopeWithoutChildren($query)
57 57
     {
58 58
         return $query
59
-            ->where(function ($query) {
59
+            ->where(function($query) {
60 60
                 $query->whereDoesntHave('childrenEnrollments')
61 61
                 ->where('parent_id', null);
62 62
             })
63
-            ->orWhere(function ($query) {
63
+            ->orWhere(function($query) {
64 64
                 $query->where('parent_id', null);
65 65
             })
66 66
             ->get();
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     public function scopePeriod(Builder $query, int $periodId)
84 84
     {
85
-        return $query->whereHas('course', function ($q) use ($periodId) {
85
+        return $query->whereHas('course', function($q) use ($periodId) {
86 86
             $q->where('period_id', $periodId);
87 87
         });
88 88
     }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         }
316 316
 
317 317
         // if enabled, retrieve the default price category for the student
318
-        if (config('invoicing.price_categories_enabled') && $this->student?->price_category) {
318
+        if (config('invoicing.price_categories_enabled') && $this->student ? ->price_category) {
319 319
             $price_category = $this->student->price_category;
320 320
 
321 321
             return $this->course->$price_category ?? 0;
@@ -340,12 +340,12 @@  discard block
 block discarded – undo
340 340
         $paidAmount = 0;
341 341
 
342 342
         foreach ($this->invoices as $invoice) {
343
-            $paidAmount += $invoice->payments?->sum('value') ?? 0;
343
+            $paidAmount += $invoice->payments ? ->sum('value') ?? 0;
344 344
         }
345 345
 
346 346
         $balance -= $paidAmount;
347 347
 
348
-        return number_format(- $balance, 2);
348
+        return number_format(-$balance, 2);
349 349
     }
350 350
 
351 351
     public function cancel()
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
 
360 360
         // delete attendance records related to the enrollment
361 361
         $attendances = $this->course->attendance->where('student_id', $this->student->id);
362
-        Attendance::destroy($attendances->map(fn ($item, $key) => $item->id));
362
+        Attendance::destroy($attendances->map(fn($item, $key) => $item->id));
363 363
 
364 364
         foreach ($this->course->children as $child) {
365 365
             $attendances = $child->attendance->where('student_id', $this->student->id);
366
-            Attendance::destroy($attendances->map(fn ($item, $key) => $item->id));
366
+            Attendance::destroy($attendances->map(fn($item, $key) => $item->id));
367 367
         }
368 368
 
369 369
         $this->delete();
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
                 }
395 395
 
396 396
                 // if one book is expired
397
-                if ($this->student && $this->student->books->where('id', $book->id)->filter(fn ($book) => $book->pivot->expiry_date == null || $book->pivot->expiry_date > Carbon::now())->count() == 0) {
397
+                if ($this->student && $this->student->books->where('id', $book->id)->filter(fn($book) => $book->pivot->expiry_date == null || $book->pivot->expiry_date > Carbon::now())->count() == 0) {
398 398
                     return 'EXP';
399 399
                 }
400 400
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/EnrollmentCrudController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
                 'attribute' => 'lastname',
119 119
                 'label' => __('Last Name'),
120 120
                 'type' => 'relationship',
121
-                'searchLogic' => function ($query, $column, $searchTerm) {
122
-                    $query->orWhereHas('student', function ($q) use ($searchTerm) {
123
-                        $q->whereHas('user', function ($q) use ($searchTerm) {
121
+                'searchLogic' => function($query, $column, $searchTerm) {
122
+                    $query->orWhereHas('student', function($q) use ($searchTerm) {
123
+                        $q->whereHas('user', function($q) use ($searchTerm) {
124 124
                             $q->where('lastname', 'like', '%'.$searchTerm.'%');
125 125
                         });
126 126
                     });
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
                 'attribute' => 'firstname',
134 134
                 'label' => __('First Name'),
135 135
                 'type' => 'relationship',
136
-                'searchLogic' => function ($query, $column, $searchTerm) {
137
-                    $query->orWhereHas('student', function ($q) use ($searchTerm) {
138
-                        $q->whereHas('user', function ($q) use ($searchTerm) {
136
+                'searchLogic' => function($query, $column, $searchTerm) {
137
+                    $query->orWhereHas('student', function($q) use ($searchTerm) {
138
+                        $q->whereHas('user', function($q) use ($searchTerm) {
139 139
                             $q->where('firstname', 'like', '%'.$searchTerm.'%');
140 140
                         });
141 141
                     });
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
                 'name' => 'status_id',
228 228
                 'type' => 'select2_multiple',
229 229
                 'label'=> __('Status'),
230
-            ], fn () => EnrollmentStatusType::all()->pluck('name', 'id')->toArray(),
231
-            function ($values) {
230
+            ], fn() => EnrollmentStatusType::all()->pluck('name', 'id')->toArray(),
231
+            function($values) {
232 232
                 // if the filter is active
233 233
                 foreach (json_decode($values, null, 512, JSON_THROW_ON_ERROR) as $value) {
234 234
                     CRUD::addClause('orWhere', 'status_id', $value);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                 'name' => 'period_id',
240 240
                 'type' => 'select2',
241 241
                 'label'=> __('Period'),
242
-            ], fn () => Period::all()->pluck('name', 'id')->toArray(), function ($value) {
242
+            ], fn() => Period::all()->pluck('name', 'id')->toArray(), function($value) {
243 243
                 // if the filter is active
244 244
                 CRUD::addClause('period', $value);
245 245
             });
@@ -250,12 +250,12 @@  discard block
 block discarded – undo
250 250
                     'type' => 'select2',
251 251
                     'label'=> __('Scholarship'),
252 252
                 ],
253
-                fn () => Scholarship::all()->pluck('name', 'id')->toArray(),
254
-                function ($value) { // if the filter is active
253
+                fn() => Scholarship::all()->pluck('name', 'id')->toArray(),
254
+                function($value) { // if the filter is active
255 255
                     if ($value == 'all') {
256 256
                         CRUD::addClause('whereHas', 'scholarships');
257 257
                     } else {
258
-                        CRUD::addClause('whereHas', 'scholarships', function ($q) use ($value) {
258
+                        CRUD::addClause('whereHas', 'scholarships', function($q) use ($value) {
259 259
                             $q->where('scholarships.id', $value);
260 260
                         });
261 261
                     }
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
             ->get();
276 276
 
277 277
         // get related comments
278
-        $comments = $enrollment->invoices->map(fn (Invoice $invoice) => $invoice->comments)->flatten()->concat($enrollment->comments);
278
+        $comments = $enrollment->invoices->map(fn(Invoice $invoice) => $invoice->comments)->flatten()->concat($enrollment->comments);
279 279
 
280 280
         $scholarships = Scholarship::all();
281 281
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             'model'     => \App\Models\Course::class, // foreign key model
307 307
             'attribute' => 'name', // foreign key attribute that is shown to user
308 308
 
309
-            'options'   => (fn ($query) => $query->orderBy('level_id', 'ASC')->where('period_id', $this->crud->getCurrentEntry()->course->period_id)->get()),
309
+            'options'   => (fn($query) => $query->orderBy('level_id', 'ASC')->where('period_id', $this->crud->getCurrentEntry()->course->period_id)->get()),
310 310
         ]);
311 311
 
312 312
         CRUD::addField(array_merge([
Please login to merge, or discard this patch.
app/Models/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
         if (config('app.send_emails_for_results')) {
25 25
             // when a result is added, send a notification
26
-            static::saved(function (self $result) {
26
+            static::saved(function(self $result) {
27 27
                 Mail::to($result->enrollment->student->user->email)->locale($result->enrollment->student->user->locale)->queue(new ResultNotification($result->enrollment->course, $result->enrollment->student->user));
28 28
             });
29 29
         }
Please login to merge, or discard this patch.
app/Models/Attendance.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         parent::boot();
22 22
 
23 23
         // when an attendance record is added, we check if this is an absence
24
-        static::saved(function (self $attendance) {
24
+        static::saved(function(self $attendance) {
25 25
             if (config('app.send_emails_for_absences') && $attendance->attendance_type_id == 4) { // todo move to configurable settings
26 26
                 // Log::info('Absence marked for student '.$attendance->student->name);
27 27
                 // will check the record again and send a notification if it hasn't changed
Please login to merge, or discard this patch.
app/Models/Student.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function scopeEnrolled($query)
44 44
     {
45
-        return $query->whereHas('enrollments', function ($q) {
46
-            return $q->whereHas('course', function ($q) {
45
+        return $query->whereHas('enrollments', function($q) {
46
+            return $q->whereHas('course', function($q) {
47 47
                 return $q->where('period_id', Period::get_default_period()->id);
48 48
             });
49 49
         });
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 
52 52
     public function scopeComputedLeadType($query, $leadTypeId)
53 53
     {
54
-        return match ($leadTypeId) {
55
-            1 => $query->whereHas('enrollments', fn ($query) => $query->whereHas('course', function ($q) {
54
+        return match($leadTypeId) {
55
+            1 => $query->whereHas('enrollments', fn($query) => $query->whereHas('course', function($q) {
56 56
                 $q->where('period_id', Period::get_default_period()->id);
57 57
             })),
58 58
 
@@ -60,15 +60,15 @@  discard block
 block discarded – undo
60 60
 
61 61
             4 => $query
62 62
                 ->where('lead_type_id', $leadTypeId)
63
-                ->orWhere(function ($query) {
63
+                ->orWhere(function($query) {
64 64
                     $query
65 65
                         ->whereNull('lead_type_id')
66
-                        ->whereHas('enrollments', fn ($query) => $query
67
-                            ->whereHas('course', function ($q) {
66
+                        ->whereHas('enrollments', fn($query) => $query
67
+                            ->whereHas('course', function($q) {
68 68
                                 $q->where('period_id', '!=', Period::get_default_period()->id);
69 69
                             }))
70
-                        ->whereDoesntHave('enrollments', fn ($query) => $query
71
-                            ->whereHas('course', function ($q) {
70
+                        ->whereDoesntHave('enrollments', fn($query) => $query
71
+                            ->whereHas('course', function($q) {
72 72
                                 $q->where('period_id', Period::get_default_period()->id);
73 73
                             }));
74 74
                 }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
         return $this->hasMany(Attendance::class)
111 111
         ->where('attendance_type_id', 4) // absence
112
-        ->whereHas('event', fn ($q) => $q->whereHas('course', fn ($c) => $c->where('period_id', $period->id)));
112
+        ->whereHas('event', fn($q) => $q->whereHas('course', fn($c) => $c->where('period_id', $period->id)));
113 113
     }
114 114
 
115 115
     public function periodAttendance(Period $period = null)
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         }
120 120
 
121 121
         return $this->hasMany(Attendance::class)
122
-        ->whereHas('event', fn ($q) => $q->whereHas('course', fn ($c) => $c->where('period_id', $period->id)));
122
+        ->whereHas('event', fn($q) => $q->whereHas('course', fn($c) => $c->where('period_id', $period->id)));
123 123
     }
124 124
 
125 125
     public function contacts()
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     public function getEmailAttribute(): ?string
182 182
     {
183
-        return $this?->user?->email;
183
+        return $this ? ->user ? ->email;
184 184
     }
185 185
 
186 186
     public function getNameAttribute(): string
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
     public function getStudentAgeAttribute()
192 192
     {
193
-        return $this->birthdate ? Carbon::parse($this->birthdate)->age . ' ' . __('years old') : '';
193
+        return $this->birthdate ? Carbon::parse($this->birthdate)->age.' '.__('years old') : '';
194 194
     }
195 195
 
196 196
     public function getStudentBirthdateAttribute()
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     public function getIsEnrolledAttribute()
202 202
     {
203 203
         // if the student is currently enrolled
204
-        if ($this->enrollments()->whereHas('course', fn ($q) => $q->where('period_id', Period::get_default_period()->id))->count() > 0) {
204
+        if ($this->enrollments()->whereHas('course', fn($q) => $q->where('period_id', Period::get_default_period()->id))->count() > 0) {
205 205
             return 1;
206 206
         }
207 207
 
Please login to merge, or discard this patch.
app/Models/Teacher.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,22 +36,22 @@  discard block
 block discarded – undo
36 36
     /** attributes */
37 37
     public function getFirstnameAttribute() : ?string
38 38
     {
39
-        return $this?->user?->firstname;
39
+        return $this ? ->user ? ->firstname;
40 40
     }
41 41
 
42 42
     public function getLastnameAttribute() : ?string
43 43
     {
44
-        return $this?->user?->lastname;
44
+        return $this ? ->user ? ->lastname;
45 45
     }
46 46
 
47 47
     public function getEmailAttribute() : ?string
48 48
     {
49
-        return $this?->user?->email;
49
+        return $this ? ->user ? ->email;
50 50
     }
51 51
 
52 52
     public function getNameAttribute() : ?string
53 53
     {
54
-        return $this?->user?->firstname.' '.$this?->user?->lastname;
54
+        return $this ? ->user ? ->firstname.' '.$this ? ->user ? ->lastname;
55 55
     }
56 56
 
57 57
     public function period_courses(Period $period)
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
         $eventsWithMissingAttendance = [];
176 176
 
177 177
         $eventsWithExpectedAttendance = $this->events()
178
-        ->where(function ($query) {
178
+        ->where(function($query) {
179 179
             $query->where('exempt_attendance', '!=', true);
180 180
             $query->where('exempt_attendance', '!=', 1);
181 181
             $query->orWhereNull('exempt_attendance');
182 182
         })
183 183
         ->where('course_id', '!=', null)
184
-        ->whereHas('course', fn (Builder $query) => $query->where('period_id', $period->id)
185
-            ->where(function ($query) {
184
+        ->whereHas('course', fn(Builder $query) => $query->where('period_id', $period->id)
185
+            ->where(function($query) {
186 186
                 $query->where('exempt_attendance', '!=', true);
187 187
                 $query->where('exempt_attendance', '!=', 1);
188 188
                 $query->orWhereNull('exempt_attendance');
Please login to merge, or discard this patch.
app/Models/Policies/CommentPolicy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
      */
27 27
     public function store_student_comment(User $user, Student $student)
28 28
     {
29
-        return ($student->enrollments()->whereHas('course', fn ($q) => $q->where('teacher_id', $user->id))->count() > 0) || $user->can('comments.edit');
29
+        return ($student->enrollments()->whereHas('course', fn($q) => $q->where('teacher_id', $user->id))->count() > 0) || $user->can('comments.edit');
30 30
     }
31 31
 }
Please login to merge, or discard this patch.