@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $this->hideSensitiveRequestDetails(); |
| 22 | 22 | |
| 23 | - Telescope::filter(function (IncomingEntry $entry) { |
|
| 23 | + Telescope::filter(function(IncomingEntry $entry) { |
|
| 24 | 24 | if ($this->app->isLocal()) { |
| 25 | 25 | return true; |
| 26 | 26 | } |
@@ -61,6 +61,6 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | protected function gate() |
| 63 | 63 | { |
| 64 | - Gate::define('viewTelescope', fn ($user = null) => backpack_user() && backpack_user()->email === config('app.admin_email')); |
|
| 64 | + Gate::define('viewTelescope', fn($user = null) => backpack_user() && backpack_user()->email === config('app.admin_email')); |
|
| 65 | 65 | } |
| 66 | 66 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // get past events for the course |
| 115 | - $events = $course->events->filter(fn ($value, $key) => Carbon::parse($value->start) < Carbon::now())->sortByDesc('start'); |
|
| 115 | + $events = $course->events->filter(fn($value, $key) => Carbon::parse($value->start) < Carbon::now())->sortByDesc('start'); |
|
| 116 | 116 | |
| 117 | 117 | // if the course has any past events |
| 118 | 118 | if (($events->count() == 0) || ($course->enrollments()->count() == 0)) { |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | public function toggleEventAttendanceStatus(Event $event, Request $request) |
| 198 | 198 | { |
| 199 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 199 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 200 | 200 | abort(403); |
| 201 | 201 | } |
| 202 | 202 | $event->exempt_attendance = (int) $request->status; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | public function toggleCourseAttendanceStatus(Course $course, Request $request) |
| 209 | 209 | { |
| 210 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 210 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 211 | 211 | abort(403); |
| 212 | 212 | } |
| 213 | 213 | $course->exempt_attendance = (int) $request->status; |
@@ -166,9 +166,9 @@ |
||
| 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 | } |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | $username_parts = array_filter(explode(' ', strtolower($fullName))); |
| 32 | 32 | $username_parts = array_slice($username_parts, -2); |
| 33 | 33 | |
| 34 | - $part1 = (! empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : ''; |
|
| 35 | - $part2 = (! empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : ''; |
|
| 34 | + $part1 = (!empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : ''; |
|
| 35 | + $part2 = (!empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : ''; |
|
| 36 | 36 | $part3 = random_int(999, 9999); |
| 37 | 37 | |
| 38 | 38 | //str_shuffle to randomly shuffle all characters |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | |
| 126 | 126 | // if registration is closed, deny access |
| 127 | - if (! config('backpack.base.registration_open')) { |
|
| 127 | + if (!config('backpack.base.registration_open')) { |
|
| 128 | 128 | abort(403, trans('backpack::base.registration_closed')); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -71,7 +71,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -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 | |