@@ -208,8 +208,8 @@ |
||
| 208 | 208 | foreach ($course->enrollments as $enrollment) { |
| 209 | 209 | // if a student has no attendance record for the class (event) |
| 210 | 210 | $hasNotAttended = $course->attendance->where('student_id', $enrollment->student_id) |
| 211 | - ->where('event_id', $event->id) |
|
| 212 | - ->isEmpty(); |
|
| 211 | + ->where('event_id', $event->id) |
|
| 212 | + ->isEmpty(); |
|
| 213 | 213 | |
| 214 | 214 | // count one and break loop |
| 215 | 215 | if ($hasNotAttended) { |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | parent::boot(); |
| 29 | 29 | |
| 30 | - static::addGlobalScope('order', function (Builder $builder) { |
|
| 30 | + static::addGlobalScope('order', function(Builder $builder) { |
|
| 31 | 31 | $builder->orderBy('year_id')->orderBy('order')->orderBy('id'); |
| 32 | 32 | }); |
| 33 | 33 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | { |
| 177 | 177 | $period = self::where('id', '<', $this->id)->orderBy('id', 'desc')->first(); |
| 178 | 178 | |
| 179 | - if (! $period == null) { |
|
| 179 | + if (!$period == null) { |
|
| 180 | 180 | return $period; |
| 181 | 181 | } else { |
| 182 | 182 | return self::first(); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | public function getCoursesWithPendingAttendanceAttribute() |
| 257 | 257 | { |
| 258 | 258 | // get all courses for period and preload relations |
| 259 | - $courses = $this->courses()->where(function ($query) { |
|
| 259 | + $courses = $this->courses()->where(function($query) { |
|
| 260 | 260 | $query->where('exempt_attendance', '!=', true); |
| 261 | 261 | $query->where('exempt_attendance', '!=', 1); |
| 262 | 262 | $query->orWhereNull('exempt_attendance'); |
@@ -20,14 +20,14 @@ |
||
| 20 | 20 | parent::boot(); |
| 21 | 21 | |
| 22 | 22 | // do not save already existing leaves |
| 23 | - static::saving(function (self $leave) { |
|
| 23 | + static::saving(function(self $leave) { |
|
| 24 | 24 | if (self::where('teacher_id', $leave->teacher_id)->where('date', $leave->date)->count() > 0) { |
| 25 | 25 | return false; |
| 26 | 26 | } |
| 27 | 27 | }); |
| 28 | 28 | |
| 29 | 29 | // when a leave is, we detach the events from the teacher |
| 30 | - static::saved(function (self $leave) { |
|
| 30 | + static::saved(function(self $leave) { |
|
| 31 | 31 | $events = Event::where('teacher_id', $leave->teacher_id)->whereDate('start', $leave->date)->get(); |
| 32 | 32 | foreach ($events as $event) { |
| 33 | 33 | $event->teacher_id = null; |
@@ -15,12 +15,12 @@ |
||
| 15 | 15 | parent::boot(); |
| 16 | 16 | |
| 17 | 17 | // when a coursetime is added, we should create corresponding events |
| 18 | - static::created(function ($coursetime) { |
|
| 18 | + static::created(function($coursetime) { |
|
| 19 | 19 | $coursetime->create_events(); |
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | 22 | // when a coursetime is deleted, we should delete all associated future events |
| 23 | - static::deleted(function ($coursetime) { |
|
| 23 | + static::deleted(function($coursetime) { |
|
| 24 | 24 | $coursetime->events()->delete(); |
| 25 | 25 | // todo delete only future events |
| 26 | 26 | }); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | return $this->respondToUnauthorizedRequest($request); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if (! $this->checkIfUserIsAdmin(backpack_user())) { |
|
| 59 | + if (!$this->checkIfUserIsAdmin(backpack_user())) { |
|
| 60 | 60 | return $this->respondToUnauthorizedRequest($request); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | return redirect()->to('login'); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - if (! backpack_user()->can($permission)) { |
|
| 22 | + if (!backpack_user()->can($permission)) { |
|
| 23 | 23 | abort(403); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | return redirect('/login'); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - if (! backpack_auth()->user()->hasRole($role)) { |
|
| 22 | + if (!backpack_auth()->user()->hasRole($role)) { |
|
| 23 | 23 | abort(403); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | protected function redirectTo($request) |
| 16 | 16 | { |
| 17 | - if (! $request->expectsJson()) { |
|
| 17 | + if (!$request->expectsJson()) { |
|
| 18 | 18 | return route('login'); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | { |
| 18 | 18 | |
| 19 | 19 | // Check if is allowed and set default locale if not |
| 20 | - if (! language()->allowed($locale)) { |
|
| 20 | + if (!language()->allowed($locale)) { |
|
| 21 | 21 | $locale = config('app.locale'); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | |
| 136 | 136 | public function import(Course $course, Request $request) |
| 137 | 137 | { |
| 138 | - if (! $request->hasFile('skillset')) { |
|
| 138 | + if (!$request->hasFile('skillset')) { |
|
| 139 | 139 | abort(422, 'No file has been uploaded'); |
| 140 | 140 | } |
| 141 | 141 | |