@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | ->where('end', '<', Carbon::now()->addDays(90)) |
| 26 | 26 | ->orderBy('id', 'desc') |
| 27 | 27 | ->get() |
| 28 | - ->map(fn ($event) => [ |
|
| 28 | + ->map(fn($event) => [ |
|
| 29 | 29 | 'title' => $event->name, |
| 30 | 30 | 'resourceId' => $event->room_id, |
| 31 | 31 | 'start' => $event->start, |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $rooms = Room::all()->toArray(); |
| 39 | 39 | |
| 40 | - $rooms = array_map(fn ($room) => [ |
|
| 40 | + $rooms = array_map(fn($room) => [ |
|
| 41 | 41 | 'id' => $room['id'], |
| 42 | 42 | 'title' => $room['name'], |
| 43 | 43 | ], $rooms); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $unassigned_events = Event::with('course') |
| 48 | 48 | ->whereNull('room_id') |
| 49 | 49 | ->get() |
| 50 | - ->map(fn ($event) => [ |
|
| 50 | + ->map(fn($event) => [ |
|
| 51 | 51 | 'title' => $event->name, |
| 52 | 52 | 'resourceId' => 'tbd', |
| 53 | 53 | 'start' => $event->start, |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public function show(Room $room) |
| 71 | 71 | { |
| 72 | 72 | $events = $room->events->toArray(); |
| 73 | - $events = array_map(fn ($event) => [ |
|
| 73 | + $events = array_map(fn($event) => [ |
|
| 74 | 74 | 'title' => $event['name'], |
| 75 | 75 | 'start' => $event['start'], |
| 76 | 76 | 'end' => $event['end'], |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function styling() |
| 17 | 17 | { |
| 18 | - return match ($this->id) { |
|
| 18 | + return match($this->id) { |
|
| 19 | 19 | 1 => 'warning', |
| 20 | 20 | 2 => 'info', |
| 21 | 21 | default => 'danger', |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | parent::boot(); |
| 26 | 26 | |
| 27 | - static::addGlobalScope('order', function (Builder $builder) { |
|
| 27 | + static::addGlobalScope('order', function(Builder $builder) { |
|
| 28 | 28 | $builder->orderBy('year_id')->orderBy('order')->orderBy('id'); |
| 29 | 29 | }); |
| 30 | 30 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | ->where('courses.period_id', $this->id) |
| 155 | 155 | ->where('enrollments.deleted_at', null) |
| 156 | 156 | ->where('enrollments.parent_id', null) |
| 157 | - ->where(function ($query) { |
|
| 157 | + ->where(function($query) { |
|
| 158 | 158 | return $query->where('students.gender_id', 0)->orWhereNull('students.gender_id'); |
| 159 | 159 | }) |
| 160 | 160 | ->whereIn('enrollments.status_id', ['1', '2']) // filter out cancelled enrollments, todo make this configurable. |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $period = self::where('id', '<', $this->id)->orderBy('id', 'desc')->first(); |
| 203 | 203 | |
| 204 | - if (! $period == null) { |
|
| 204 | + if (!$period == null) { |
|
| 205 | 205 | return $period; |
| 206 | 206 | } else { |
| 207 | 207 | return self::first(); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | public function getCoursesWithPendingAttendanceAttribute() |
| 282 | 282 | { |
| 283 | 283 | // get all courses for period and preload relations |
| 284 | - $courses = $this->courses()->where(function ($query) { |
|
| 284 | + $courses = $this->courses()->where(function($query) { |
|
| 285 | 285 | $query->where('exempt_attendance', '!=', true); |
| 286 | 286 | $query->where('exempt_attendance', '!=', 1); |
| 287 | 287 | $query->orWhereNull('exempt_attendance'); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | ->where('periods.year_id', $this->id) |
| 47 | 47 | ->whereIn('enrollments.status_id', ['1', '2']) // filter out cancelled enrollments, todo make this configurable. |
| 48 | 48 | ->where('enrollments.parent_id', null)->where('enrollments.deleted_at', null) |
| 49 | - ->where(function ($query) { |
|
| 49 | + ->where(function($query) { |
|
| 50 | 50 | return $query->where('students.gender_id', 0)->orWhereNull('students.gender_id'); |
| 51 | 51 | }) |
| 52 | 52 | ->distinct('student_id')->count('enrollments.student_id'); |
@@ -53,12 +53,12 @@ |
||
| 53 | 53 | |
| 54 | 54 | View::composer( |
| 55 | 55 | ['partials.create_new_contact', 'students.edit-contact'], |
| 56 | - function ($view) { |
|
| 56 | + function($view) { |
|
| 57 | 57 | $view->with('contact_types', ContactRelationship::all()); |
| 58 | 58 | } |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | - View::composer('partials.add_book_to_student', function ($view) { |
|
| 61 | + View::composer('partials.add_book_to_student', function($view) { |
|
| 62 | 62 | $view->with('books', Book::all()); |
| 63 | 63 | $view->with('statuses', EnrollmentStatusType::all()); |
| 64 | 64 | }); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'label' => __('Due Date'), |
| 51 | 51 | ], |
| 52 | 52 | false, |
| 53 | - function ($value) { // if the filter is active, apply these constraints |
|
| 53 | + function($value) { // if the filter is active, apply these constraints |
|
| 54 | 54 | $this->crud->addClause('where', 'date', '>=', Carbon::parse($value)->firstOfMonth()); |
| 55 | 55 | $this->crud->addClause('where', 'date', '<=', Carbon::parse($value)->lastOfMonth()); |
| 56 | 56 | } |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $payment = Payment::findOrFail($id); |
| 94 | 94 | |
| 95 | - if (! backpack_user()->can('enrollments.edit')) { |
|
| 95 | + if (!backpack_user()->can('enrollments.edit')) { |
|
| 96 | 96 | abort(403); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (! $payment->invoice) { |
|
| 99 | + if (!$payment->invoice) { |
|
| 100 | 100 | abort(404, 'No enrollment found for this payment'); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $year_data = []; |
| 64 | 64 | $years = []; // New array |
| 65 | 65 | |
| 66 | - if (! isset($request->period)) { |
|
| 66 | + if (!isset($request->period)) { |
|
| 67 | 67 | $startperiod = Period::find(Config::where('name', 'first_external_period')->first()->value ?? Period::first()->id); |
| 68 | 68 | } else { |
| 69 | 69 | $startperiod = Period::find($request->period); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | ->where('id', '>=', $startperiod->id) |
| 204 | 204 | ->get() |
| 205 | 205 | ->groupBy('year_id') |
| 206 | - ->map(function ($yearData) { |
|
| 206 | + ->map(function($yearData) { |
|
| 207 | 207 | $yearPeriods = []; |
| 208 | 208 | |
| 209 | 209 | foreach ($yearData as $period) { |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | private function getStartperiod(Request $request) |
| 309 | 309 | { |
| 310 | - if (! isset($request->period)) { |
|
| 310 | + if (!isset($request->period)) { |
|
| 311 | 311 | $startperiod = Period::find(Config::where('name', 'first_period')->first()->value); |
| 312 | 312 | } else { |
| 313 | 313 | $startperiod = Period::find($request->period); |
@@ -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, |
@@ -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 | |