Passed
Push — master ( a643fc...0bc75b )
by Thomas
08:11
created
app/Http/Controllers/Admin/ExternalCourseCrudController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -168,58 +168,58 @@  discard block
 block discarded – undo
168 168
         ]);
169 169
 
170 170
         CRUD::addFilter(
171
-            [ // select2 filter
171
+            [// select2 filter
172 172
                 'name' => 'rhythm_id',
173 173
                 'type' => 'select2',
174 174
                 'label'=> __('Rhythm'),
175 175
             ],
176
-            fn () => Rhythm::all()->pluck('name', 'id')->toArray(),
177
-            function ($value) { // if the filter is active
176
+            fn() => Rhythm::all()->pluck('name', 'id')->toArray(),
177
+            function($value) { // if the filter is active
178 178
                 CRUD::addClause('where', 'rhythm_id', $value);
179 179
             },
180
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
180
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
181 181
             }
182 182
         );
183 183
 
184 184
         CRUD::addFilter(
185
-            [ // select2 filter
185
+            [// select2 filter
186 186
                 'name' => 'teacher_id',
187 187
                 'type' => 'select2',
188 188
                 'label'=> __('Teacher'),
189 189
             ],
190
-            fn () => Teacher::all()->pluck('name', 'id')->toArray(),
191
-            function ($value) { // if the filter is active
190
+            fn() => Teacher::all()->pluck('name', 'id')->toArray(),
191
+            function($value) { // if the filter is active
192 192
                 CRUD::addClause('where', 'teacher_id', $value);
193 193
             },
194
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
194
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
195 195
             }
196 196
         );
197 197
 
198 198
         CRUD::addFilter(
199
-            [ // select2 filter
199
+            [// select2 filter
200 200
                 'name' => 'level_id',
201 201
                 'type' => 'select2',
202 202
                 'label'=> __('Level'),
203 203
             ],
204
-            fn () => Level::all()->pluck('name', 'id')->toArray(),
205
-            function ($value) { // if the filter is active
204
+            fn() => Level::all()->pluck('name', 'id')->toArray(),
205
+            function($value) { // if the filter is active
206 206
                 CRUD::addClause('where', 'level_id', $value);
207 207
             },
208
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
208
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
209 209
             }
210 210
         );
211 211
 
212 212
         CRUD::addFilter(
213
-            [ // select2 filter
213
+            [// select2 filter
214 214
                 'name' => 'period_id',
215 215
                 'type' => 'select2',
216 216
                 'label'=> __('Period'),
217 217
             ],
218
-            fn () => Period::all()->pluck('name', 'id')->toArray(),
219
-            function ($value) { // if the filter is active
218
+            fn() => Period::all()->pluck('name', 'id')->toArray(),
219
+            function($value) { // if the filter is active
220 220
                 CRUD::addClause('where', 'period_id', $value);
221 221
             },
222
-            function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
222
+            function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit)
223 223
                 $period = Period::get_default_period()->id;
224 224
                 CRUD::addClause('where', 'period_id', $period);
225 225
                 $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
                 'tab' => __('Course info'),
366 366
             ],
367 367
 
368
-            [   // repeatable
368
+            [// repeatable
369 369
                 'name'  => 'times',
370 370
                 'label' => __('Course Schedule'),
371 371
                 'type'  => 'repeatable',
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                 'tab' => __('Schedule'),
405 405
             ],
406 406
 
407
-            [   // view
407
+            [// view
408 408
                 'name' => 'custom-ajax-button',
409 409
                 'type' => 'view',
410 410
                 'view' => 'courses/schedule-preset-alert',
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
                 'tab' => __('Course info'),
559 559
             ],
560 560
 
561
-            [   // repeatable
561
+            [// repeatable
562 562
                 'name'  => 'times',
563 563
                 'label' => __('Course Schedule'),
564 564
                 'type'  => 'repeatable',
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ScheduledPaymentCrudController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
             'attribute' => 'lastname',
44 44
             'label' => __('Last Name'),
45 45
             'type' => 'relationship',
46
-            'searchLogic' => function ($query, $column, $searchTerm) {
47
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
48
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
46
+            'searchLogic' => function($query, $column, $searchTerm) {
47
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
48
+                    $q->whereHas('user', function($q) use ($searchTerm) {
49 49
                         $q->where('lastname', 'like', '%'.$searchTerm.'%');
50 50
                     });
51 51
                 });
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
             'attribute' => 'firstname',
59 59
             'label' => __('First Name'),
60 60
             'type' => 'relationship',
61
-            'searchLogic' => function ($query, $column, $searchTerm) {
62
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
63
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
61
+            'searchLogic' => function($query, $column, $searchTerm) {
62
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
63
+                    $q->whereHas('user', function($q) use ($searchTerm) {
64 64
                         $q->where('firstname', 'like', '%'.$searchTerm.'%');
65 65
                     });
66 66
                 });
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
             'attribute' => 'email',
74 74
             'label' => __('Email'),
75 75
             'type' => 'relationship',
76
-            'searchLogic' => function ($query, $column, $searchTerm) {
77
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
78
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
76
+            'searchLogic' => function($query, $column, $searchTerm) {
77
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
78
+                    $q->whereHas('user', function($q) use ($searchTerm) {
79 79
                         $q->where('email', 'like', '%'.$searchTerm.'%');
80 80
                     });
81 81
                 });
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
             'name' => 'status_id',
106 106
             'type' => 'select2',
107 107
             'label'=> __('Status'),
108
-        ], fn () => [
108
+        ], fn() => [
109 109
             1 => __('Pending'),
110 110
             2 => __('Paid'),
111 111
         ],
112
-            function ($value) { // if the filter is active
112
+            function($value) { // if the filter is active
113 113
                 CRUD::addClause('status', $value);
114 114
             });
115 115
     }
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', // foreign key attribute that is shown to user
47 47
                 'model'     => \App\Models\User::class, // foreign key model
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', // foreign key attribute that is shown to user
65 65
                 'model'     => \App\Models\User::class, // foreign key model
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', // foreign key attribute that is shown to user
82 82
                 'model'     => \App\Models\User::class, // foreign key model
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/SkillCrudController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     protected function setupListOperation()
32 32
     {
33 33
         CRUD::setColumns([
34
-            [ // skill type
34
+            [// skill type
35 35
                 'label'     => 'Type', // Table column heading
36 36
                 'type'      => 'select',
37 37
                 'name'      => 'skill_type', // the method that defines the relationship in your Model
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                 'type' => 'text',
45 45
                 'name' => 'name',
46 46
             ],
47
-            [ // skill level
47
+            [// skill level
48 48
                 'label'     => 'Level', // Table column heading
49 49
                 'type'      => 'select',
50 50
                 'name'      => 'level', // the method that defines the relationship in your Model
@@ -56,19 +56,19 @@  discard block
 block discarded – undo
56 56
 
57 57
         CRUD::enableExportButtons();
58 58
 
59
-        CRUD::addFilter([ // select2 filter
59
+        CRUD::addFilter([// select2 filter
60 60
             'name' => 'level_id',
61 61
             'type' => 'select2',
62 62
             'label'=> 'Level',
63
-        ], fn () => Level::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active
63
+        ], fn() => Level::all()->pluck('name', 'id')->toArray(), function($value) { // if the filter is active
64 64
             CRUD::addClause('where', 'level_id', $value);
65 65
         });
66 66
 
67
-        CRUD::addFilter([ // select2 filter
67
+        CRUD::addFilter([// select2 filter
68 68
             'name' => 'skill_type_id',
69 69
             'type' => 'select2',
70 70
             'label'=> 'Type',
71
-        ], fn () => SkillType::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active
71
+        ], fn() => SkillType::all()->pluck('name', 'id')->toArray(), function($value) { // if the filter is active
72 72
             CRUD::addClause('where', 'skill_type_id', $value);
73 73
         });
74 74
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     {
78 78
         CRUD::setValidation(StoreRequest::class);
79 79
         CRUD::addFields([
80
-            [ // skill type
80
+            [// skill type
81 81
                 'label'     => 'Type', // Table column heading
82 82
                 'type' => 'select',
83 83
                 'name' => 'skill_type_id', // the db column for the foreign key
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 'type' => 'text',
91 91
                 'name' => 'name',
92 92
             ],
93
-            [ // skill level
93
+            [// skill level
94 94
                 'label'     => 'Level', // Table column heading
95 95
                 'type' => 'select',
96 96
                 'name' => 'level_id', // the db column for the foreign key
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                 'type' => 'relationship',
104 104
                 'name' => 'skill_type', // the method on your model that defines the relationship
105 105
                 'ajax' => true,
106
-                'inline_create' => [ // specify the entity in singular
106
+                'inline_create' => [// specify the entity in singular
107 107
                     'entity' => 'skilltype', // the entity in singular
108 108
                     // OPTIONALS
109 109
                     'force_select' => true, // should the inline-created entry be immediately selected?
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -166,9 +166,9 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
         $username_parts = array_filter(explode(' ', strtolower($fullName)));
31 31
         $username_parts = array_slice($username_parts, -2);
32 32
 
33
-        $part1 = (! empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
34
-        $part2 = (! empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
33
+        $part1 = (!empty($username_parts[0])) ? substr($username_parts[0], 0, 3) : '';
34
+        $part2 = (!empty($username_parts[1])) ? substr($username_parts[1], 0, 8) : '';
35 35
         $part3 = random_int(999, 9999);
36 36
 
37 37
         $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Http/Controllers/BookController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
app/Http/Controllers/InvoiceController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 
72 72
         // persist the products
73 73
         foreach ($request->products as $f => $product) {
74
-            $productType = match ($product['type']) {
74
+            $productType = match($product['type']) {
75 75
                 'enrollment' => Enrollment::class,
76 76
                 'scheduledPayment' => Enrollment::class,
77 77
                 'fee' => Fee::class,
Please login to merge, or discard this patch.
app/Http/Controllers/TeacherCalendarController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $events = Event::with('course')
26 26
             ->where('start', '>', Carbon::now()->subDays(30))->where('end', '<', Carbon::now()->addDays(30))->orderBy('id', 'desc') // TODO optimize this.
27 27
             ->get()
28
-            ->map(fn ($event) => [
28
+            ->map(fn($event) => [
29 29
                 'title' => $event['name'] ?? '',
30 30
                 'resourceId' => $event['teacher_id'],
31 31
                 'start' => $event['start'],
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
 
38 38
         $teachers = Teacher::all()->toArray();
39 39
 
40
-        $teachers = array_map(fn ($teacher) => [
40
+        $teachers = array_map(fn($teacher) => [
41 41
             'id' => $teacher['id'],
42 42
             'title' => $teacher['name'] ?? '',
43 43
         ], $teachers);
44 44
 
45 45
         array_push($teachers, ['id' => 'tbd', 'title' => 'Unassigned']);
46 46
 
47
-        $unassigned_events = Event::unassigned()->get()->map(fn ($event) => [
47
+        $unassigned_events = Event::unassigned()->get()->map(fn($event) => [
48 48
             'title' => $event['name'] ?? '',
49 49
             'resourceId' => 'tbd',
50 50
             'start' => $event['start'],
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             'borderColor' => $event['color'],
55 55
         ]);
56 56
 
57
-        $leaves = Leave::orderBy('date', 'desc')->limit(10000)->get()->map(fn ($event) => [
57
+        $leaves = Leave::orderBy('date', 'desc')->limit(10000)->get()->map(fn($event) => [
58 58
             'title' => $event->leaveType->name ?? 'ABS', // todo fix
59 59
             'resourceId' => $event['teacher_id'],
60 60
             'start' => $event['date'],
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             abort(403);
81 81
         }
82 82
 
83
-        $events = $teacher->events->map(fn ($event) => [
83
+        $events = $teacher->events->map(fn($event) => [
84 84
             'title' => $event['name'],
85 85
             'start' => $event['start'],
86 86
             'end' => $event['end'],
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
             'borderColor' => $event['color'],
89 89
         ]);
90 90
 
91
-        $leaves = $teacher->leaves->map(fn ($event) => [
92
-            'title' => $event->leaveType->name ?? 'vacances',  // todo fix
91
+        $leaves = $teacher->leaves->map(fn($event) => [
92
+            'title' => $event->leaveType->name ?? 'vacances', // todo fix
93 93
             'start' => $event['date'],
94 94
             'allDay' => true,
95 95
         ]);
Please login to merge, or discard this patch.
app/Http/Controllers/HomeController.php 1 patch
Spacing   +6 added lines, -6 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);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             'total_enrollment_count' => $currentPeriod->internal_enrollments_count,
123 123
             'resources' => $teachers,
124 124
             'events' => $events,
125
-            'pending_attendance' => $currentPeriod->courses_with_pending_attendance,  // todo: optimize
125
+            'pending_attendance' => $currentPeriod->courses_with_pending_attendance, // todo: optimize
126 126
             'unassigned_events' => Event::unassigned()->count(),
127 127
             'pending_leads' => LeadType::find(4)->students()->count(),
128 128
         ]);
Please login to merge, or discard this patch.