@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | 'profession' => 'required', |
| 54 | 54 | 'institution' => 'required', |
| 55 | 55 | 'userPicture' => 'required', |
| 56 | - function ($attribute, $value, $fail) { |
|
| 56 | + function($attribute, $value, $fail) { |
|
| 57 | 57 | $size = strlen(base64_decode($value)); |
| 58 | 58 | |
| 59 | 59 | if ($size > 3145728) { |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $img = imagecreatefromstring($value); |
| 64 | 64 | |
| 65 | - if (! $img) { |
|
| 65 | + if (!$img) { |
|
| 66 | 66 | $fail($attribute.'Invalid image'); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $size = getimagesizefromstring($value); |
| 70 | 70 | |
| 71 | - if (! $size || ($size[0] == 0) || ($size[1] == 0) || ! $size['mime']) { |
|
| 71 | + if (!$size || ($size[0] == 0) || ($size[1] == 0) || !$size['mime']) { |
|
| 72 | 72 | $fail($attribute.'is invalid'); |
| 73 | 73 | } |
| 74 | 74 | }, |
@@ -121,7 +121,7 @@ discard block |
||
| 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 | |
@@ -29,12 +29,12 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | protected function schedule(Schedule $schedule) |
| 31 | 31 | { |
| 32 | - $schedule->call(function () { |
|
| 32 | + $schedule->call(function() { |
|
| 33 | 33 | Log::info('Sending attendance reminders'); |
| 34 | 34 | (new Attendance())->remindPendingAttendance(); |
| 35 | 35 | })->dailyAt('08:15'); |
| 36 | 36 | |
| 37 | - $schedule->call(function () { |
|
| 37 | + $schedule->call(function() { |
|
| 38 | 38 | Log::info('Checking default periods'); |
| 39 | 39 | |
| 40 | 40 | // when we finish the current period; remove the manual override to automatically fallbackto the next one |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | parent::boot(); |
| 19 | 19 | |
| 20 | 20 | // before adding an event, we check that the teacher is available |
| 21 | - static::saving(function ($event) { |
|
| 21 | + static::saving(function($event) { |
|
| 22 | 22 | $teacher = Teacher::find($event->teacher_id); |
| 23 | 23 | // if the teacher is on leave on the day of the event |
| 24 | 24 | if (($event->teacher_id !== null) && $teacher->leaves->contains('date', Carbon::parse($event->start)->toDateString())) { |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | parent::boot(); |
| 28 | 28 | |
| 29 | 29 | // when creating a new enrollment, also add past attendance |
| 30 | - static::created(function (self $enrollment) { |
|
| 30 | + static::created(function(self $enrollment) { |
|
| 31 | 31 | $events = $enrollment->course->events->where('start', '<', (new Carbon())->toDateString()); |
| 32 | 32 | foreach ($events as $event) { |
| 33 | 33 | $event->attendance()->create([ |
@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | public function scopeWithoutChildren($query) |
| 59 | 59 | { |
| 60 | 60 | return $query |
| 61 | - ->where(function ($query) { |
|
| 61 | + ->where(function($query) { |
|
| 62 | 62 | $query->whereDoesntHave('childrenEnrollments') |
| 63 | 63 | ->where('parent_id', null); |
| 64 | 64 | }) |
| 65 | - ->orWhere(function ($query) { |
|
| 65 | + ->orWhere(function($query) { |
|
| 66 | 66 | $query->where('parent_id', null); |
| 67 | 67 | }) |
| 68 | 68 | ->get(); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | public function scopePeriod(Builder $query, $period) |
| 86 | 86 | { |
| 87 | - return $query->whereHas('course', function ($q) use ($period) { |
|
| 87 | + return $query->whereHas('course', function($q) use ($period) { |
|
| 88 | 88 | $q->where('period_id', $period); |
| 89 | 89 | }); |
| 90 | 90 | } |
@@ -293,13 +293,13 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | // delete attendance records related to the enrollment |
| 295 | 295 | $attendances = $this->course->attendance->where('student_id', $this->student->id); |
| 296 | - Attendance::destroy($attendances->map(function ($item, $key) { |
|
| 296 | + Attendance::destroy($attendances->map(function($item, $key) { |
|
| 297 | 297 | return $item->id; |
| 298 | 298 | })); |
| 299 | 299 | |
| 300 | 300 | foreach ($this->course->children as $child) { |
| 301 | 301 | $attendances = $child->attendance->where('student_id', $this->student->id); |
| 302 | - Attendance::destroy($attendances->map(function ($item, $key) { |
|
| 302 | + Attendance::destroy($attendances->map(function($item, $key) { |
|
| 303 | 303 | return $item->id; |
| 304 | 304 | })); |
| 305 | 305 | } |