@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 69 | $course = Course::with('evaluationType')->find($enrollment->course_id); |
70 | 70 | |
71 | - $skills = $course->skills->map(function ($skill, $key) use ($student_skills) { |
|
71 | + $skills = $course->skills->map(function($skill, $key) use ($student_skills) { |
|
72 | 72 | $skill['status'] = $student_skills->where('skill_id', $skill->id)->first()->skill_scale_id ?? null; |
73 | 73 | |
74 | 74 | return $skill; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | parent::boot(); |
22 | 22 | |
23 | 23 | // before adding an event, we check that the teacher is available |
24 | - static::saving(function ($event) { |
|
24 | + static::saving(function($event) { |
|
25 | 25 | $teacher = Teacher::find($event->teacher_id); |
26 | 26 | // if the teacher is on leave on the day of the event |
27 | 27 | if ($event->teacher_id !== null && $teacher) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | public function getColorAttribute() |
150 | 150 | { |
151 | - return $this?->course->color ?? ('#'.substr(md5($this->course_id ?? '0'), 0, 6)); |
|
151 | + return $this ? ->course->color ?? ('#'.substr(md5($this->course_id ?? '0'), 0, 6)); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /* |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function skills() |
205 | 205 | { |
206 | - return $this->evaluationType?->skills()->orderBy('order'); |
|
206 | + return $this->evaluationType ? ->skills()->orderBy('order'); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | public function books() |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function getPendingAttendanceAttribute() |
230 | 230 | { |
231 | - $events = Event::where(function ($query) { |
|
231 | + $events = Event::where(function($query) { |
|
232 | 232 | $query->where('course_id', $this->id); |
233 | 233 | $query->where('exempt_attendance', '!=', true); |
234 | 234 | $query->where('exempt_attendance', '!=', 1); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | foreach ($courseTimes as $courseTime) { |
362 | 362 | $initial = $daysInitials[$courseTime->day]; |
363 | 363 | |
364 | - if (! isset($parsedCourseTimes[$initial])) { |
|
364 | + if (!isset($parsedCourseTimes[$initial])) { |
|
365 | 365 | $parsedCourseTimes[$initial] = []; |
366 | 366 | } |
367 | 367 | |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | public function getCourseTeacherNameAttribute() |
409 | 409 | { |
410 | 410 | if ($this->teacher_id) { |
411 | - return $this->teacher?->name; |
|
411 | + return $this->teacher ? ->name; |
|
412 | 412 | } else { |
413 | 413 | return '-'; |
414 | 414 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | |
442 | 442 | public function getAcceptsNewStudentsAttribute(): bool |
443 | 443 | { |
444 | - if (! $this->spots || $this->spots == 0) { |
|
444 | + if (!$this->spots || $this->spots == 0) { |
|
445 | 445 | return true; |
446 | 446 | } |
447 | 447 | |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | |
465 | 465 | public function eventsWithExpectedAttendance() |
466 | 466 | { |
467 | - return $this->events()->where(function ($query) { |
|
467 | + return $this->events()->where(function($query) { |
|
468 | 468 | $query->where('exempt_attendance', '!=', true); |
469 | 469 | $query->where('exempt_attendance', '!=', 1); |
470 | 470 | $query->orWhereNull('exempt_attendance'); |
@@ -27,6 +27,6 @@ |
||
27 | 27 | { |
28 | 28 | // if the student is enrolled in any class by the user |
29 | 29 | |
30 | - return $student->enrollments()->whereHas('course', fn ($q) => $q->where('teacher_id', $user->id))->count() > 0; |
|
30 | + return $student->enrollments()->whereHas('course', fn($q) => $q->where('teacher_id', $user->id))->count() > 0; |
|
31 | 31 | } |
32 | 32 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | public function getFormattedStartDateAttribute() |
26 | 26 | { |
27 | - if (! $this->started_on) { |
|
27 | + if (!$this->started_on) { |
|
28 | 28 | return '-'; |
29 | 29 | } |
30 | 30 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | public function getFormattedEndDateAttribute() |
35 | 35 | { |
36 | - if (! $this->expired_on) { |
|
36 | + if (!$this->expired_on) { |
|
37 | 37 | return '-'; |
38 | 38 | } |
39 | 39 |
@@ -20,7 +20,7 @@ |
||
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; |
@@ -23,7 +23,7 @@ |
||
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 | } |
@@ -21,7 +21,7 @@ |
||
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 |
@@ -36,22 +36,22 @@ discard block |
||
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 |
||
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'); |