@@ -71,7 +71,7 @@ |
||
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' => ScheduledPayment::class, |
77 | 77 | 'fee' => Fee::class, |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | public function scopeStatus(Builder $query, $status) |
29 | 29 | { |
30 | - return match ($status) { |
|
30 | + return match($status) { |
|
31 | 31 | '2' => $query->where('status', 2), |
32 | 32 | '1' => $query->where('status', 1), |
33 | 33 | default => $query, |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | public function getStatusTypeNameAttribute() |
121 | 121 | { |
122 | - return match ($this->status) { |
|
122 | + return match($this->status) { |
|
123 | 123 | 2 => __('Paid'), |
124 | 124 | 1 => __('Pending'), |
125 | 125 | default => '-', |
@@ -46,10 +46,10 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | protected function setupListOperation() |
32 | 32 | { |
33 | 33 | CRUD::setColumns([ |
34 | - [ // skill type |
|
34 | + [// skill type |
|
35 | 35 | 'label' => 'Type', |
36 | 36 | 'type' => 'select', |
37 | 37 | 'name' => 'skill_type', |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | 'type' => 'text', |
45 | 45 | 'name' => 'name', |
46 | 46 | ], |
47 | - [ // skill level |
|
47 | + [// skill level |
|
48 | 48 | 'label' => 'Level', |
49 | 49 | 'type' => 'select', |
50 | 50 | 'name' => 'level', |
@@ -56,19 +56,19 @@ discard block |
||
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 |
||
77 | 77 | { |
78 | 78 | CRUD::setValidation(StoreRequest::class); |
79 | 79 | CRUD::addFields([ |
80 | - [ // skill type |
|
80 | + [// skill type |
|
81 | 81 | 'label' => 'Type', |
82 | 82 | 'type' => 'select', |
83 | 83 | 'name' => 'skill_type_id', |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | 'type' => 'text', |
91 | 91 | 'name' => 'name', |
92 | 92 | ], |
93 | - [ // skill level |
|
93 | + [// skill level |
|
94 | 94 | 'label' => 'Level', |
95 | 95 | 'type' => 'select', |
96 | 96 | 'name' => 'level_id', |
@@ -103,7 +103,7 @@ discard block |
||
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? |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | 'price_b' => $enrollment->course->price_b, |
184 | 184 | 'price_c' => $enrollment->course->price_c, |
185 | 185 | ]), |
186 | - 'studentPriceCategory' => $enrollment->student?->price_category, |
|
186 | + 'studentPriceCategory' => $enrollment->student ? ->price_category, |
|
187 | 187 | ] |
188 | 188 | ); |
189 | 189 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | public function getBalance(Request $request) |
223 | 223 | { |
224 | - if (! config('invoicing.invoices_contain_enrollments_only')) { |
|
224 | + if (!config('invoicing.invoices_contain_enrollments_only')) { |
|
225 | 225 | abort(422, 'Configuration options forbid to access this value'); |
226 | 226 | } |
227 | 227 |
@@ -228,8 +228,7 @@ |
||
228 | 228 | $periodId = $request->get('periodId'); |
229 | 229 | if ($periodId) { |
230 | 230 | $pendingBalance = Enrollment::period($periodId)->pending()->sum('balance'); |
231 | - } |
|
232 | - else { |
|
231 | + } else { |
|
233 | 232 | $pendingBalance = Enrollment::pending()->sum('balance'); |
234 | 233 | } |
235 | 234 |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | public function scopeWithoutChildren($query) |
61 | 61 | { |
62 | 62 | return $query |
63 | - ->where(function ($query) { |
|
63 | + ->where(function($query) { |
|
64 | 64 | $query->whereDoesntHave('childrenEnrollments') |
65 | 65 | ->where('parent_id', null); |
66 | 66 | }) |
67 | - ->orWhere(function ($query) { |
|
67 | + ->orWhere(function($query) { |
|
68 | 68 | $query->where('parent_id', null); |
69 | 69 | }) |
70 | 70 | ->get(); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | public function scopePeriod(Builder $query, int $periodId) |
88 | 88 | { |
89 | - return $query->whereHas('course', function ($q) use ($periodId) { |
|
89 | + return $query->whereHas('course', function($q) use ($periodId) { |
|
90 | 90 | $q->where('period_id', $periodId); |
91 | 91 | }); |
92 | 92 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | // also includes invoices for this enrollment's scheduled payments. |
181 | 181 | public function relatedInvoices() |
182 | 182 | { |
183 | - $scheduledPaymentsInvoices = $this->scheduledPayments->map(fn (ScheduledPayment $scheduledPayment) => $scheduledPayment->invoices()); |
|
183 | + $scheduledPaymentsInvoices = $this->scheduledPayments->map(fn(ScheduledPayment $scheduledPayment) => $scheduledPayment->invoices()); |
|
184 | 184 | |
185 | 185 | return $this->invoices()->concat($scheduledPaymentsInvoices)->flatten(1); |
186 | 186 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | } |
333 | 333 | |
334 | 334 | // if enabled, retrieve the default price category for the student |
335 | - if (config('invoicing.price_categories_enabled') && $this->student?->price_category) { |
|
335 | + if (config('invoicing.price_categories_enabled') && $this->student ? ->price_category) { |
|
336 | 336 | $price_category = $this->student->price_category; |
337 | 337 | |
338 | 338 | return $this->course->$price_category ?? 0; |
@@ -362,11 +362,11 @@ discard block |
||
362 | 362 | |
363 | 363 | // delete attendance records related to the enrollment |
364 | 364 | $attendances = $this->course->attendance->where('student_id', $this->student->id); |
365 | - Attendance::destroy($attendances->map(fn ($item, $key) => $item->id)); |
|
365 | + Attendance::destroy($attendances->map(fn($item, $key) => $item->id)); |
|
366 | 366 | |
367 | 367 | foreach ($this->course->children as $child) { |
368 | 368 | $attendances = $child->attendance->where('student_id', $this->student->id); |
369 | - Attendance::destroy($attendances->map(fn ($item, $key) => $item->id)); |
|
369 | + Attendance::destroy($attendances->map(fn($item, $key) => $item->id)); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | $this->delete(); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | // if one book is expired |
400 | - if ($this->student && $this->student->books->where('id', $book->id)->filter(fn ($book) => $book->pivot->expiry_date == null || $book->pivot->expiry_date > Carbon::now())->count() == 0) { |
|
400 | + if ($this->student && $this->student->books->where('id', $book->id)->filter(fn($book) => $book->pivot->expiry_date == null || $book->pivot->expiry_date > Carbon::now())->count() == 0) { |
|
401 | 401 | return 'EXP'; |
402 | 402 | } |
403 | 403 | } |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | |
409 | 409 | public function getBalanceAttribute() |
410 | 410 | { |
411 | - if (! config('invoicing.invoices_contain_enrollments_only')) { |
|
411 | + if (!config('invoicing.invoices_contain_enrollments_only')) { |
|
412 | 412 | abort(422, 'Configuration options forbid to access this value'); |
413 | 413 | } |
414 | 414 |
@@ -93,83 +93,83 @@ discard block |
||
93 | 93 | $currency = ['suffix' => config('app.currency_symbol')]; |
94 | 94 | } |
95 | 95 | |
96 | - CRUD::addColumns([['name' => 'id', 'label' => 'ID', 'wrapper' => ['element' => function ($crud, $column, $entry) { |
|
96 | + CRUD::addColumns([['name' => 'id', 'label' => 'ID', 'wrapper' => ['element' => function($crud, $column, $entry) { |
|
97 | 97 | return $entry->status_id > 2 ? 'del' : 'span'; |
98 | - },],], |
|
98 | + },], ], |
|
99 | 99 | |
100 | - ['label' => __('ID number'), 'type' => 'text', 'name' => 'student.idnumber', 'wrapper' => ['element' => function ($crud, $column, $entry) { |
|
100 | + ['label' => __('ID number'), 'type' => 'text', 'name' => 'student.idnumber', 'wrapper' => ['element' => function($crud, $column, $entry) { |
|
101 | 101 | return $entry->status_id > 2 ? 'del' : 'span'; |
102 | - },],], |
|
102 | + },], ], |
|
103 | 103 | |
104 | - ['name' => 'user', 'key' => 'user_lastname', 'attribute' => 'lastname', 'label' => __('Last Name'), 'type' => 'relationship', 'wrapper' => ['element' => function ($crud, $column, $entry) { |
|
104 | + ['name' => 'user', 'key' => 'user_lastname', 'attribute' => 'lastname', 'label' => __('Last Name'), 'type' => 'relationship', 'wrapper' => ['element' => function($crud, $column, $entry) { |
|
105 | 105 | return $entry->status_id > 2 ? 'del' : 'span'; |
106 | - },], 'searchLogic' => function ($query, $column, $searchTerm) { |
|
107 | - $query->orWhereHas('student', function ($q) use ($searchTerm) { |
|
108 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
109 | - $q->where('lastname', 'like', '%' . $searchTerm . '%'); |
|
106 | + },], 'searchLogic' => function($query, $column, $searchTerm) { |
|
107 | + $query->orWhereHas('student', function($q) use ($searchTerm) { |
|
108 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
109 | + $q->where('lastname', 'like', '%'.$searchTerm.'%'); |
|
110 | 110 | }); |
111 | 111 | }); |
112 | 112 | },], |
113 | 113 | |
114 | - ['name' => 'user', 'key' => 'user_firstname', 'attribute' => 'firstname', 'label' => __('First Name'), 'type' => 'relationship', 'wrapper' => ['element' => function ($crud, $column, $entry) { |
|
114 | + ['name' => 'user', 'key' => 'user_firstname', 'attribute' => 'firstname', 'label' => __('First Name'), 'type' => 'relationship', 'wrapper' => ['element' => function($crud, $column, $entry) { |
|
115 | 115 | return $entry->status_id > 2 ? 'del' : 'span'; |
116 | - },], 'searchLogic' => function ($query, $column, $searchTerm) { |
|
117 | - $query->orWhereHas('student', function ($q) use ($searchTerm) { |
|
118 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
119 | - $q->where('firstname', 'like', '%' . $searchTerm . '%'); |
|
116 | + },], 'searchLogic' => function($query, $column, $searchTerm) { |
|
117 | + $query->orWhereHas('student', function($q) use ($searchTerm) { |
|
118 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
119 | + $q->where('firstname', 'like', '%'.$searchTerm.'%'); |
|
120 | 120 | }); |
121 | 121 | }); |
122 | 122 | },], |
123 | 123 | |
124 | - ['label' => __('Age'), 'name' => 'student_age',], |
|
124 | + ['label' => __('Age'), 'name' => 'student_age', ], |
|
125 | 125 | |
126 | - ['label' => __('Birthdate'), 'name' => 'student_birthdate',],]); |
|
126 | + ['label' => __('Birthdate'), 'name' => 'student_birthdate', ], ]); |
|
127 | 127 | |
128 | 128 | if ($this->mode === 'global') { |
129 | - CRUD::addColumns([['label' => __('Course'), 'type' => 'select', 'name' => 'course_id', 'entity' => 'course', 'attribute' => 'name', 'model' => Course::class,], ['type' => 'relationship', 'name' => 'course.period', 'label' => __('Period'), 'attribute' => 'name',],]); |
|
129 | + CRUD::addColumns([['label' => __('Course'), 'type' => 'select', 'name' => 'course_id', 'entity' => 'course', 'attribute' => 'name', 'model' => Course::class, ], ['type' => 'relationship', 'name' => 'course.period', 'label' => __('Period'), 'attribute' => 'name', ], ]); |
|
130 | 130 | } |
131 | 131 | |
132 | - CRUD::addColumns([['label' => __('Status'), 'type' => 'select', 'name' => 'status_id', 'entity' => 'enrollmentStatus', 'attribute' => 'name', 'model' => EnrollmentStatusType::class, 'wrapper' => ['element' => 'span', 'class' => function ($crud, $column, $entry) { |
|
133 | - return 'badge badge-pill badge-' . $entry->enrollmentStatus->styling(); |
|
134 | - },],],]); |
|
132 | + CRUD::addColumns([['label' => __('Status'), 'type' => 'select', 'name' => 'status_id', 'entity' => 'enrollmentStatus', 'attribute' => 'name', 'model' => EnrollmentStatusType::class, 'wrapper' => ['element' => 'span', 'class' => function($crud, $column, $entry) { |
|
133 | + return 'badge badge-pill badge-'.$entry->enrollmentStatus->styling(); |
|
134 | + },], ], ]); |
|
135 | 135 | |
136 | 136 | if (config('invoicing.allow_scheduled_payments')) { |
137 | 137 | CRUD::addColumn(['name' => 'scheduledPayments', 'type' => 'relationship', 'label' => __('Scheduled Payments'), // OPTIONAL |
138 | - 'attribute' => 'date', 'model' => ScheduledPayment::class,]); |
|
138 | + 'attribute' => 'date', 'model' => ScheduledPayment::class, ]); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | CRUD::addColumn(array_merge(['name' => 'price', // The db column name |
142 | - 'label' => __('Price'), 'type' => 'number',], $currency)); |
|
142 | + 'label' => __('Price'), 'type' => 'number', ], $currency)); |
|
143 | 143 | |
144 | 144 | |
145 | 145 | if (config('invoicing.invoices_contain_enrollments_only')) { |
146 | - CRUD::addColumn(array_merge(['name' => 'balance', 'label' => __('Balance'), 'type' => 'number',], $currency)); |
|
146 | + CRUD::addColumn(array_merge(['name' => 'balance', 'label' => __('Balance'), 'type' => 'number', ], $currency)); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | CRUD::addColumns([ |
150 | 150 | |
151 | - ['name' => 'scholarships', 'type' => 'relationship', 'label' => __('Scholarship'), 'attribute' => 'name', 'model' => Scholarship::class,], |
|
151 | + ['name' => 'scholarships', 'type' => 'relationship', 'label' => __('Scholarship'), 'attribute' => 'name', 'model' => Scholarship::class, ], |
|
152 | 152 | |
153 | - ['label' => __('Email'), 'name' => 'user', 'attribute' => 'email', 'type' => 'relationship',], |
|
153 | + ['label' => __('Email'), 'name' => 'user', 'attribute' => 'email', 'type' => 'relationship', ], |
|
154 | 154 | |
155 | - ['label' => __('Phone Number'), 'type' => 'select_multiple', 'name' => 'student.phone', 'attribute' => 'phone_number', 'model' => PhoneNumber::class,],]); |
|
155 | + ['label' => __('Phone Number'), 'type' => 'select_multiple', 'name' => 'student.phone', 'attribute' => 'phone_number', 'model' => PhoneNumber::class, ], ]); |
|
156 | 156 | |
157 | 157 | if ($this->mode === 'global') { |
158 | - CRUD::addFilter(['name' => 'status_id', 'type' => 'select2_multiple', 'label' => __('Status'),], fn() => EnrollmentStatusType::all()->pluck('name', 'id')->toArray(), function ($values) { |
|
158 | + CRUD::addFilter(['name' => 'status_id', 'type' => 'select2_multiple', 'label' => __('Status'), ], fn() => EnrollmentStatusType::all()->pluck('name', 'id')->toArray(), function($values) { |
|
159 | 159 | foreach (json_decode($values, null, 512, JSON_THROW_ON_ERROR) as $value) { |
160 | 160 | CRUD::addClause('orWhere', 'status_id', $value); |
161 | 161 | } |
162 | 162 | }); |
163 | 163 | |
164 | - CRUD::addFilter(['name' => 'period_id', 'type' => 'select2', 'label' => __('Period'),], fn() => Period::all()->pluck('name', 'id')->toArray(), function ($value) { |
|
164 | + CRUD::addFilter(['name' => 'period_id', 'type' => 'select2', 'label' => __('Period'), ], fn() => Period::all()->pluck('name', 'id')->toArray(), function($value) { |
|
165 | 165 | CRUD::addClause('period', $value); |
166 | 166 | }); |
167 | 167 | |
168 | - CRUD::addFilter(['name' => 'scholarship', 'type' => 'select2', 'label' => __('Scholarship'),], fn() => Scholarship::all()->pluck('name', 'id')->toArray(), function ($value) { // if the filter is active |
|
168 | + CRUD::addFilter(['name' => 'scholarship', 'type' => 'select2', 'label' => __('Scholarship'), ], fn() => Scholarship::all()->pluck('name', 'id')->toArray(), function($value) { // if the filter is active |
|
169 | 169 | if ($value == 'all') { |
170 | 170 | CRUD::addClause('whereHas', 'scholarships'); |
171 | 171 | } else { |
172 | - CRUD::addClause('whereHas', 'scholarships', function ($q) use ($value) { |
|
172 | + CRUD::addClause('whereHas', 'scholarships', function($q) use ($value) { |
|
173 | 173 | $q->where('scholarships.id', $value); |
174 | 174 | }); |
175 | 175 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | 'model' => Course::class, |
215 | 215 | 'attribute' => 'name', |
216 | 216 | |
217 | - 'options' => (fn ($query) => $query->orderBy('level_id', 'ASC')->where('period_id', $this->crud->getCurrentEntry()->course->period_id)->get()), |
|
217 | + 'options' => (fn($query) => $query->orderBy('level_id', 'ASC')->where('period_id', $this->crud->getCurrentEntry()->course->period_id)->get()), |
|
218 | 218 | ]); |
219 | 219 | |
220 | 220 | CRUD::addField(array_merge([ |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | CRUD::setModel(Invoice::class); |
30 | 30 | CRUD::setRoute(config('backpack.base.route_prefix').'/invoice'); |
31 | 31 | CRUD::setEntityNameStrings(__('invoice'), __('invoices')); |
32 | - if (! config('invoicing.price_categories_enabled')) { |
|
32 | + if (!config('invoicing.price_categories_enabled')) { |
|
33 | 33 | $this->crud->addButtonFromView('top', 'createInvoice', 'createInvoice', 'start'); |
34 | 34 | } |
35 | 35 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'label'=> __('Date range'), |
105 | 105 | ], |
106 | 106 | false, |
107 | - function ($value) { // if the filter is active, apply these constraints |
|
107 | + function($value) { // if the filter is active, apply these constraints |
|
108 | 108 | $dates = json_decode($value, null, 512, JSON_THROW_ON_ERROR); |
109 | 109 | |
110 | 110 | if ($dates->from) { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | { |
148 | 148 | $invoice = Invoice::findOrFail($id)->load('payments'); |
149 | 149 | |
150 | - if (! backpack_user()->can('enrollments.edit')) { |
|
150 | + if (!backpack_user()->can('enrollments.edit')) { |
|
151 | 151 | abort(403); |
152 | 152 | } |
153 | 153 |