Passed
Push — master ( 01762b...9640e5 )
by Thomas
07:40
created
app/Http/Controllers/Admin/StudentCrudController.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
                 'attribute' => 'lastname',
93 93
                 'model' => User::class,
94 94
                 'orderable' => true,
95
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
95
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
96 96
                     ->orderBy('users.lastname', $columnDirection)->select('students.*'),
97
-                'searchLogic' => function ($query, $column, $searchTerm) {
98
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
97
+                'searchLogic' => function($query, $column, $searchTerm) {
98
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
99 99
                         $q->where('lastname', 'like', '%'.$searchTerm.'%');
100 100
                     });
101 101
                 },
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
                 'attribute' => 'firstname',
111 111
                 'model' => User::class,
112 112
                 'orderable' => true,
113
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
113
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
114 114
                     ->orderBy('users.firstname', $columnDirection)->select('students.*'),
115
-                'searchLogic' => function ($query, $column, $searchTerm) {
116
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
115
+                'searchLogic' => function($query, $column, $searchTerm) {
116
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
117 117
                         $q->where('firstname', 'like', '%'.$searchTerm.'%');
118 118
                     });
119 119
                 },
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
                 'attribute' => 'email',
128 128
                 'model' => User::class,
129 129
                 'orderable' => true,
130
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
130
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
131 131
                     ->orderBy('users.email', $columnDirection)->select('students.*'),
132
-                'searchLogic' => function ($query, $column, $searchTerm) {
133
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
132
+                'searchLogic' => function($query, $column, $searchTerm) {
133
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
134 134
                         $q->where('email', 'like', '%'.$searchTerm.'%');
135 135
                     });
136 136
                 },
@@ -177,28 +177,28 @@  discard block
 block discarded – undo
177 177
         ]);
178 178
 
179 179
         CRUD::addFilter(
180
-            [ // select2 filter
180
+            [// select2 filter
181 181
                 'name' => 'enrolled',
182 182
                 'type' => 'select2',
183 183
                 'label' => __('Is Enrolled in'),
184 184
             ],
185
-            fn () => Period::all()->pluck('name', 'id')->toArray(),
186
-            function ($value) {
187
-                $this->crud->query = $this->crud->query->whereHas('enrollments', fn ($query) => $query->whereHas('course', function ($q) use ($value) {
185
+            fn() => Period::all()->pluck('name', 'id')->toArray(),
186
+            function($value) {
187
+                $this->crud->query = $this->crud->query->whereHas('enrollments', fn($query) => $query->whereHas('course', function($q) use ($value) {
188 188
                     $q->where('period_id', $value);
189 189
                 }));
190 190
             },
191
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
191
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
192 192
             }
193 193
         );
194 194
 
195
-        CRUD::addFilter([ // select2_multiple filter
195
+        CRUD::addFilter([// select2_multiple filter
196 196
             'name' => 'notenrolled',
197 197
             'type' => 'select2_multiple',
198 198
             'label' => __('Is Not Enrolled in'),
199
-        ], fn () => Period::all()->pluck('name', 'id')->toArray(), function ($values) {
199
+        ], fn() => Period::all()->pluck('name', 'id')->toArray(), function($values) {
200 200
             foreach (json_decode($values, null, 512, JSON_THROW_ON_ERROR) as $value) {
201
-                $this->crud->query = $this->crud->query->whereDoesntHave('enrollments', fn ($query) => $query->whereHas('course', function ($q) use ($value) {
201
+                $this->crud->query = $this->crud->query->whereDoesntHave('enrollments', fn($query) => $query->whereHas('course', function($q) use ($value) {
202 202
                     $q->where('period_id', $value);
203 203
                 }));
204 204
             }
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
                 'type' => 'select2',
211 211
                 'label' => __('New In'),
212 212
             ],
213
-            fn () => Period::all()->pluck('name', 'id')->toArray(),
214
-            function ($value) {
213
+            fn() => Period::all()->pluck('name', 'id')->toArray(),
214
+            function($value) {
215 215
                 CRUD::addClause('newInPeriod', $value);
216 216
             }
217 217
         );
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             'name' => 'institution_id',
222 222
             'type' => 'select2',
223 223
             'label' => __('Institution'),
224
-        ], fn () => Institution::all()->pluck('name', 'id')->toArray(), function ($value) {
224
+        ], fn() => Institution::all()->pluck('name', 'id')->toArray(), function($value) {
225 225
             $this->crud->addClause('where', 'institution_id', $value);
226 226
         });
227 227
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
             'name' => 'status_type_id',
230 230
             'type' => 'select2',
231 231
             'label' => __('Lead Status'),
232
-        ], fn () => LeadType::all()->pluck('name', 'id')->toArray(), function ($value) {
232
+        ], fn() => LeadType::all()->pluck('name', 'id')->toArray(), function($value) {
233 233
             if ($value === '4') {
234 234
                 $this->crud->query = $this->crud->query->where('lead_type_id', $value)->orWhere('lead_type_id', null);
235 235
             } else {
@@ -350,8 +350,8 @@  discard block
 block discarded – undo
350 350
         $username_parts = array_filter(explode(' ', strtolower($fullName)));
351 351
         $username_parts = array_slice($username_parts, -2);
352 352
 
353
-        $part1 = (! empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
354
-        $part2 = (! empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
353
+        $part1 = (!empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
354
+        $part2 = (!empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
355 355
         $part3 = random_int(999, 9999);
356 356
 
357 357
         $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
     {
440 440
         $student = Student::findOrFail($student);
441 441
 
442
-        if (! backpack_user()->isTeacher() && ! backpack_user()->can('enrollments.view')) {
442
+        if (!backpack_user()->isTeacher() && !backpack_user()->can('enrollments.view')) {
443 443
             abort(403);
444 444
         }
445 445
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/TeacherCrudController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
                 'attribute' => 'lastname',
47 47
                 'model' => User::class,
48 48
                 'orderable' => true,
49
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
49
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'students.id')
50 50
                     ->orderBy('users.lastname', $columnDirection)->select('students.*'),
51
-                'searchLogic' => function ($query, $column, $searchTerm) {
52
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
51
+                'searchLogic' => function($query, $column, $searchTerm) {
52
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
53 53
                         $q->where('lastname', 'like', '%'.$searchTerm.'%');
54 54
                     });
55 55
                 },
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
                 'attribute' => 'firstname',
65 65
                 'model' => User::class,
66 66
                 'orderable' => true,
67
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'teachers.id')
67
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'teachers.id')
68 68
                     ->orderBy('users.firstname', $columnDirection)->select('teachers.*'),
69
-                'searchLogic' => function ($query, $column, $searchTerm) {
70
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
69
+                'searchLogic' => function($query, $column, $searchTerm) {
70
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
71 71
                         $q->where('firstname', 'like', '%'.$searchTerm.'%');
72 72
                     });
73 73
                 },
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
                 'attribute' => 'email',
82 82
                 'model' => User::class,
83 83
                 'orderable' => true,
84
-                'orderLogic' => fn ($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'teachers.id')
84
+                'orderLogic' => fn($query, $column, $columnDirection) => $query->leftJoin('users', 'users.id', '=', 'teachers.id')
85 85
                     ->orderBy('users.email', $columnDirection)->select('teachers.*'),
86
-                'searchLogic' => function ($query, $column, $searchTerm) {
87
-                    $query->orWhereHas('user', function ($q) use ($searchTerm) {
86
+                'searchLogic' => function($query, $column, $searchTerm) {
87
+                    $query->orWhereHas('user', function($q) use ($searchTerm) {
88 88
                         $q->where('email', 'like', '%'.$searchTerm.'%');
89 89
                     });
90 90
                 },
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
         $username_parts = array_filter(explode(' ', strtolower($fullName)));
182 182
         $username_parts = array_slice($username_parts, -2);
183 183
 
184
-        $part1 = (! empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
185
-        $part2 = (! empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
184
+        $part1 = (!empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
185
+        $part2 = (!empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
186 186
         $part3 = random_int(999, 9999);
187 187
 
188 188
         $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/EvaluationTypeCrudController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             'label' => 'Name',
40 40
             'type' => 'text', ]);
41 41
 
42
-        CRUD::addField([    // Select2Multiple = n-n relationship (with pivot table)
42
+        CRUD::addField([// Select2Multiple = n-n relationship (with pivot table)
43 43
             'label' => __('Grade Types'),
44 44
             'type' => 'select2_multiple',
45 45
             'name' => 'gradeTypes',
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             // show Select All and Clear buttons?
55 55
         ]);
56 56
 
57
-        CRUD::addField([    // Select2Multiple = n-n relationship (with pivot table)
57
+        CRUD::addField([// Select2Multiple = n-n relationship (with pivot table)
58 58
             'label' => __('Skills'),
59 59
             'type' => 'select2_multiple',
60 60
             'name' => 'skills',
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ResultCrudController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
                 'type' => 'select',
53 53
                 'name' => 'student',
54 54
                 'attribute' => 'name',
55
-                'searchLogic' => function ($query, $column, $searchTerm) {
56
-                    $query->orWhereHas('student', function ($q) use ($searchTerm) {
57
-                        $q->WhereHas('user', function ($q) use ($searchTerm) {
55
+                'searchLogic' => function($query, $column, $searchTerm) {
56
+                    $query->orWhereHas('student', function($q) use ($searchTerm) {
57
+                        $q->WhereHas('user', function($q) use ($searchTerm) {
58 58
                             $q->where('firstname', 'like', '%'.$searchTerm.'%')
59 59
                             ->orWhere('lastname', 'like', '%'.$searchTerm.'%')
60 60
                             ->orWhere('email', 'like', '%'.$searchTerm.'%')
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 'label' => __('No Result'),
95 95
             ],
96 96
             false,
97
-            function () {
97
+            function() {
98 98
                 CRUD::addClause('noResult');
99 99
             }
100 100
         );
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 'label' => __('Hide Parents'),
107 107
             ],
108 108
             false,
109
-            function () {
109
+            function() {
110 110
                 CRUD::addClause('real');
111 111
             }
112 112
         );
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
             'name' => 'period_id',
116 116
             'type' => 'select2',
117 117
             'label' => __('Period'),
118
-        ], fn () => Period::all()->pluck('name', 'id')->toArray(), function ($value) {
118
+        ], fn() => Period::all()->pluck('name', 'id')->toArray(), function($value) {
119 119
             CRUD::addClause('period', $value);
120 120
         });
121 121
 
122
-        CRUD::addFilter([ // select2_multiple filter
122
+        CRUD::addFilter([// select2_multiple filter
123 123
             'name' => 'result',
124 124
             'type' => 'select2',
125 125
             'label' => __('Result'),
126
-        ], fn () => ResultType::all()->pluck('name', 'id')->toArray(), function ($value) {
127
-            $this->crud->query = $this->crud->query->whereHas('result', function ($query) use ($value) {
126
+        ], fn() => ResultType::all()->pluck('name', 'id')->toArray(), function($value) {
127
+            $this->crud->query = $this->crud->query->whereHas('result', function($query) use ($value) {
128 128
                 $query->where('result_type_id', $value);
129 129
             });
130 130
         });
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/LeaveCrudController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -69,27 +69,27 @@  discard block
 block discarded – undo
69 69
         ]);
70 70
 
71 71
         CRUD::addFilter(
72
-            [ // select2 filter
72
+            [// select2 filter
73 73
                 'name' => 'teacher_id',
74 74
                 'type' => 'select2',
75 75
                 'label' => __('Teacher'),
76 76
             ],
77
-            fn () => Teacher::all()->pluck('name', 'id')->toArray(),
78
-            function ($value) {
77
+            fn() => Teacher::all()->pluck('name', 'id')->toArray(),
78
+            function($value) {
79 79
                 CRUD::addClause('where', 'teacher_id', $value);
80 80
             },
81
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
81
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
82 82
             }
83 83
         );
84 84
 
85 85
         CRUD::addFilter(
86
-            [ // daterange filter
86
+            [// daterange filter
87 87
                 'type' => 'date_range',
88 88
                 'name' => 'from_to',
89 89
                 'label' => __('Date range'),
90 90
             ],
91 91
             false,
92
-            function ($value) { // if the filter is active, apply these constraints
92
+            function($value) { // if the filter is active, apply these constraints
93 93
                 $dates = json_decode($value, null, 512, JSON_THROW_ON_ERROR);
94 94
                 CRUD::addClause('where', 'date', '>=', $dates->from);
95 95
                 CRUD::addClause('where', 'date', '<=', $dates->to.' 23:59:59');
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                 'model' => LeaveType::class,
123 123
             ],
124 124
 
125
-            [   // date_range
125
+            [// date_range
126 126
                 'name' => ['start_date', 'end_date'],
127 127
                 // db columns for start_date & end_date
128 128
                 'label' => 'Event Date Range',
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 'model' => LeaveType::class,
169 169
             ],
170 170
 
171
-            [   // datepicker
171
+            [// datepicker
172 172
                 'name' => 'date',
173 173
                 'label' => 'Event Date',
174 174
                 'type' => 'date',
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/SkillCrudController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     protected function setupListOperation()
33 33
     {
34 34
         CRUD::setColumns([
35
-            [ // skill type
35
+            [// skill type
36 36
                 'label' => 'Type',
37 37
                 'type' => 'select',
38 38
                 'name' => 'skill_type',
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                 'type' => 'text',
47 47
                 'name' => 'name',
48 48
             ],
49
-            [ // skill level
49
+            [// skill level
50 50
                 'label' => 'Level',
51 51
                 'type' => 'select',
52 52
                 'name' => 'level',
@@ -58,19 +58,19 @@  discard block
 block discarded – undo
58 58
 
59 59
         CRUD::enableExportButtons();
60 60
 
61
-        CRUD::addFilter([ // select2 filter
61
+        CRUD::addFilter([// select2 filter
62 62
             'name' => 'level_id',
63 63
             'type' => 'select2',
64 64
             'label' => 'Level',
65
-        ], fn () => Level::all()->pluck('name', 'id')->toArray(), function ($value) {
65
+        ], fn() => Level::all()->pluck('name', 'id')->toArray(), function($value) {
66 66
             CRUD::addClause('where', 'level_id', $value);
67 67
         });
68 68
 
69
-        CRUD::addFilter([ // select2 filter
69
+        CRUD::addFilter([// select2 filter
70 70
             'name' => 'skill_type_id',
71 71
             'type' => 'select2',
72 72
             'label' => 'Type',
73
-        ], fn () => SkillType::all()->pluck('name', 'id')->toArray(), function ($value) {
73
+        ], fn() => SkillType::all()->pluck('name', 'id')->toArray(), function($value) {
74 74
             CRUD::addClause('where', 'skill_type_id', $value);
75 75
         });
76 76
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         CRUD::setValidation(StoreRequest::class);
81 81
         CRUD::addFields([
82
-            [ // skill type
82
+            [// skill type
83 83
                 'label' => 'Type',
84 84
                 'type' => 'select',
85 85
                 'name' => 'skill_type_id',
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 'type' => 'text',
94 94
                 'name' => 'name',
95 95
             ],
96
-            [ // skill level
96
+            [// skill level
97 97
                 'label' => 'Level',
98 98
                 'type' => 'select',
99 99
                 'name' => 'level_id',
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 'type' => 'relationship',
107 107
                 'name' => 'skill_type',
108 108
                 'ajax' => true,
109
-                'inline_create' => [ // specify the entity in singular
109
+                'inline_create' => [// specify the entity in singular
110 110
                     'entity' => 'skilltype',
111 111
                     // the entity in singular
112 112
                     // OPTIONALS
Please login to merge, or discard this patch.
app/Http/Controllers/HomeController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     public function teacher(Request $request)
46 46
     {
47
-        if (! backpack_user()->isTeacher()) {
47
+        if (!backpack_user()->isTeacher()) {
48 48
             abort(403);
49 49
         }
50 50
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     public function student()
71 71
     {
72
-        if (! backpack_user()->isStudent()) {
72
+        if (!backpack_user()->isStudent()) {
73 73
             abort(403);
74 74
         }
75 75
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $currentPeriod = Period::get_default_period();
88 88
         $enrollmentsPeriod = Period::get_enrollments_period();
89 89
 
90
-        if (! backpack_user()->hasRole(['admin', 'secretary'])) {
90
+        if (!backpack_user()->hasRole(['admin', 'secretary'])) {
91 91
             abort(403);
92 92
         }
93 93
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         // todo optimize this !!
97 97
         $events = Event::where('start', '>', Carbon::now()->subDays(15))->where('end', '<', Carbon::now()->addDays(15))->orderBy('id', 'desc')
98 98
             ->get()
99
-            ->map(fn ($event) => [
99
+            ->map(fn($event) => [
100 100
                 'title' => $event['name'],
101 101
                 'resourceId' => $event['teacher_id'],
102 102
                 'start' => $event['start'],
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
         $teachers = Teacher::with('user')->get()->toArray();
110 110
 
111
-        $teachers = array_map(fn ($teacher) => [
111
+        $teachers = array_map(fn($teacher) => [
112 112
             'id' => $teacher['id'],
113 113
             'title' => $teacher['user']['firstname'],
114 114
         ], $teachers);
Please login to merge, or discard this patch.
app/Services/ApolearnService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
     public function updateCourse(Course $course): void
135 135
     {
136
-        if (! $course->lms_id) {
136
+        if (!$course->lms_id) {
137 137
             $this->createCourse($course);
138 138
         }
139 139
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             Log::info('found these teachers IDs on LMS:'.implode(', ', $teachers->pluck('id')->toArray()));
163 163
 
164 164
             // if the course has no teacher, stop
165
-            if (! $course->teacher) {
165
+            if (!$course->teacher) {
166 166
                 Log::alert('The course has no teacher on local system, removing all teachers from remote');
167 167
                 foreach ($teachers as $teacher) {
168 168
                     $this->removeTeacher($course->lms_id, $teacher['id']);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                     }
178 178
                 }
179 179
 
180
-                if (! $course->teacher->user->lms_id || ! $teachers->contains('id', $course->teacher->user->lms_id)) {
180
+                if (!$course->teacher->user->lms_id || !$teachers->contains('id', $course->teacher->user->lms_id)) {
181 181
                     Log::info('the course teacher has changed, need to update it');
182 182
                     $this->addTeacher($course);
183 183
                 }
@@ -187,14 +187,14 @@  discard block
 block discarded – undo
187 187
 
188 188
     public function enrollStudent(Course $course, Student $student): void
189 189
     {
190
-        if (! $course->lms_id) {
190
+        if (!$course->lms_id) {
191 191
             abort(404, 'This course is not synced with external LMS');
192 192
         }
193 193
 
194 194
         $courseId = $course->lms_id;
195 195
 
196 196
         // if the student is not synced with the LMS, create them
197
-        if (! $student->user->lms_id) {
197
+        if (!$student->user->lms_id) {
198 198
             $this->createUser($student->user);
199 199
         }
200 200
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         // only process if the course has a teacher
218 218
         if ($course->teacher_id) {
219 219
             // if the teacher doesn't exist on LMS, create them
220
-            if (! $course->teacher->user->lms_id) {
220
+            if (!$course->teacher->user->lms_id) {
221 221
                 Log::info('creating user now');
222 222
                 $this->createUser($course->teacher->user);
223 223
             }
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
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
     /** attributes */
40 40
     public function getFirstnameAttribute(): ?string
41 41
     {
42
-        return $this?->user?->firstname;
42
+        return $this ? ->user ? ->firstname;
43 43
     }
44 44
 
45 45
     public function getLastnameAttribute(): ?string
46 46
     {
47
-        return $this?->user?->lastname;
47
+        return $this ? ->user ? ->lastname;
48 48
     }
49 49
 
50 50
     public function getEmailAttribute(): ?string
51 51
     {
52
-        return $this?->user?->email;
52
+        return $this ? ->user ? ->email;
53 53
     }
54 54
 
55 55
     public function getNameAttribute(): ?string
56 56
     {
57
-        return $this?->user?->firstname.' '.$this?->user?->lastname;
57
+        return $this ? ->user ? ->firstname.' '.$this ? ->user ? ->lastname;
58 58
     }
59 59
 
60 60
     public function period_courses(Period $period)
@@ -178,14 +178,14 @@  discard block
 block discarded – undo
178 178
         $eventsWithMissingAttendance = [];
179 179
 
180 180
         $eventsWithExpectedAttendance = $this->events()
181
-        ->where(function ($query) {
181
+        ->where(function($query) {
182 182
             $query->where('exempt_attendance', '!=', true);
183 183
             $query->where('exempt_attendance', '!=', 1);
184 184
             $query->orWhereNull('exempt_attendance');
185 185
         })
186 186
         ->where('course_id', '!=', null)
187
-        ->whereHas('course', fn (Builder $query) => $query->where('period_id', $period->id)
188
-            ->where(function ($query) {
187
+        ->whereHas('course', fn(Builder $query) => $query->where('period_id', $period->id)
188
+            ->where(function($query) {
189 189
                 $query->where('exempt_attendance', '!=', true);
190 190
                 $query->where('exempt_attendance', '!=', 1);
191 191
                 $query->orWhereNull('exempt_attendance');
Please login to merge, or discard this patch.