@@ -25,7 +25,7 @@ |
||
| 25 | 25 | $subscriberGroups = $this->subscribersApi->getGroups($email); // returns array of group objects subscriber belongs to |
| 26 | 26 | |
| 27 | 27 | foreach ($subscriberGroups as $group) { |
| 28 | - $groupId = $array = json_decode(json_encode($group),true); |
|
| 28 | + $groupId = $array = json_decode(json_encode($group), true); |
|
| 29 | 29 | $this->groupsApi->removeSubscriber($groupId['id'], $email); // returns empty response |
| 30 | 30 | } |
| 31 | 31 | |
@@ -34,12 +34,12 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | protected function schedule(Schedule $schedule) |
| 36 | 36 | { |
| 37 | - $schedule->call(function () { |
|
| 37 | + $schedule->call(function() { |
|
| 38 | 38 | Log::info('Sending attendance reminders'); |
| 39 | 39 | $this->remindPendingAttendance(); |
| 40 | 40 | })->dailyAt('08:15'); |
| 41 | 41 | |
| 42 | - $schedule->call(function () { |
|
| 42 | + $schedule->call(function() { |
|
| 43 | 43 | Log::info('Checking default periods'); |
| 44 | 44 | |
| 45 | 45 | // when we finish the current period; remove the manual override to automatically fallbackto the next one |
@@ -57,14 +57,14 @@ discard block |
||
| 57 | 57 | })->dailyAt('00:00'); |
| 58 | 58 | |
| 59 | 59 | if (config('settings.partnership_alerts')) { |
| 60 | - $schedule->call(function () { |
|
| 60 | + $schedule->call(function() { |
|
| 61 | 61 | Log::info('Checking expired partnerships'); |
| 62 | 62 | |
| 63 | 63 | // if one of the partnerships is expiring soon, send an email |
| 64 | - $partners = Partner::where(function ($query) { |
|
| 64 | + $partners = Partner::where(function($query) { |
|
| 65 | 65 | $query->whereNotNull('expired_on')->where('expired_on', '<', Carbon::now()->addDays(28)); |
| 66 | 66 | }) |
| 67 | - ->where(function ($query) { |
|
| 67 | + ->where(function($query) { |
|
| 68 | 68 | $query->whereNull('last_alert_sent_at')->orWhere('last_alert_sent_at', '>', Carbon::now()->subDays(28))->get(); |
| 69 | 69 | }); |
| 70 | 70 | |
@@ -75,14 +75,14 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | if (config('settings.external_courses_report')) { |
| 78 | - $schedule->call(function () { |
|
| 78 | + $schedule->call(function() { |
|
| 79 | 79 | Log::info('Sending external courses reports'); |
| 80 | 80 | event(new ExternalCoursesReportEvent()); |
| 81 | 81 | })->dailyAt('02:10'); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | if (config('settings.monthly_report')) { |
| 85 | - $schedule->call(function () { |
|
| 85 | + $schedule->call(function() { |
|
| 86 | 86 | Log::info('Sending monthly hours report'); |
| 87 | 87 | event(new MonthlyReportEvent()); |
| 88 | 88 | })->monthlyOn(20); |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | $course = Course::find($entry->course_id); |
| 46 | 46 | $matchFound = false; |
| 47 | 47 | |
| 48 | - echo "\nMigrating grades from course " . $course->id; |
|
| 48 | + echo "\nMigrating grades from course ".$course->id; |
|
| 49 | 49 | |
| 50 | 50 | // collect all grade types associated to this course. |
| 51 | 51 | $courseGradeTypes = DB::table('course_grade_type')->where('course_id', $entry->course_id)->pluck('grade_type_id'); |
| 52 | 52 | // if this configuration matches an evaluation type, use it, otherwise create it |
| 53 | 53 | foreach (EvaluationType::has('gradeTypes')->get() as $evaluationType) { |
| 54 | 54 | if ($courseGradeTypes->diff($evaluationType->gradeTypes->pluck('id'))->count() == 0) { |
| 55 | - echo "match with eval type " . $evaluationType->id; |
|
| 55 | + echo "match with eval type ".$evaluationType->id; |
|
| 56 | 56 | $course->update(['evaluation_type_id' => $evaluationType->id]); |
| 57 | 57 | $matchFound = true; |
| 58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | // if no match has been found |
| 62 | 62 | if (!$matchFound) { |
| 63 | 63 | echo "no match; creating new eval type"; |
| 64 | - $evalType = EvaluationType::create(['name' => 'cours ' . $entry->course_id]); |
|
| 64 | + $evalType = EvaluationType::create(['name' => 'cours '.$entry->course_id]); |
|
| 65 | 65 | $evalType->gradeTypes()->sync($courseGradeTypes); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $course = Course::find($entry->course_id); |
| 75 | 75 | $matchFound = false; |
| 76 | 76 | |
| 77 | - echo "\nMigrating skills from course " . $course->id; |
|
| 77 | + echo "\nMigrating skills from course ".$course->id; |
|
| 78 | 78 | |
| 79 | 79 | // collect all grade types associated to this course. |
| 80 | 80 | $courseSkills = DB::table('course_skill')->where('course_id', $entry->course_id)->pluck('skill_id'); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | // if no match has been found |
| 91 | 91 | if (!$matchFound) { |
| 92 | 92 | $levelName = isset($course->level) ? $course->level->name : $course->id; |
| 93 | - $evalType = EvaluationType::create(['name' => 'Niveau ' . $levelName]); |
|
| 93 | + $evalType = EvaluationType::create(['name' => 'Niveau '.$levelName]); |
|
| 94 | 94 | $evalType->skills()->sync($courseSkills); |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -37,13 +37,13 @@ |
||
| 37 | 37 | $period = Period::firstWhere('name', $record['year']); |
| 38 | 38 | |
| 39 | 39 | // Retrieve or create the student |
| 40 | - $email = $record['email'] !== "" ? $record['email'] : $this->stripAccents($record['firstname']) . "." . $this->stripAccents($record['name']) . "@academico.afsantiago.es"; |
|
| 40 | + $email = $record['email'] !== "" ? $record['email'] : $this->stripAccents($record['firstname']).".".$this->stripAccents($record['name'])."@academico.afsantiago.es"; |
|
| 41 | 41 | |
| 42 | 42 | if (User::where('email', $email)->count() > 0) { |
| 43 | 43 | $user = User::where('email', $email)->first(); |
| 44 | 44 | if (($user->firstname !== trim($record['firstname']) || $user->lastname !== trim($record['name']))) |
| 45 | 45 | { |
| 46 | - $email = $this->stripAccents($record['firstname']) . "." . $this->stripAccents($record['name']) . "@academico.afsantiago.es"; |
|
| 46 | + $email = $this->stripAccents($record['firstname']).".".$this->stripAccents($record['name'])."@academico.afsantiago.es"; |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
@@ -73,10 +73,10 @@ |
||
| 73 | 73 | { |
| 74 | 74 | if (config('app.currency_position') === 'before') |
| 75 | 75 | { |
| 76 | - return config('app.currency_symbol') . " ". $this->price; |
|
| 76 | + return config('app.currency_symbol')." ".$this->price; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - return $this->price . " " . config('app.currency_symbol'); |
|
| 79 | + return $this->price." ".config('app.currency_symbol'); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function getTypeAttribute() |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function setup() |
| 31 | 31 | { |
| 32 | 32 | CRUD::setModel(\App\Models\ScheduledPayment::class); |
| 33 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/scheduled-payment'); |
|
| 33 | + CRUD::setRoute(config('backpack.base.route_prefix').'/scheduled-payment'); |
|
| 34 | 34 | CRUD::setEntityNameStrings(__('scheduled payment'), __('scheduled payments')); |
| 35 | 35 | CRUD::enableExportButtons(); |
| 36 | 36 | } |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | 'attribute' => 'lastname', |
| 50 | 50 | 'label' => __('Last Name'), |
| 51 | 51 | 'type' => 'relationship', |
| 52 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
| 53 | - $query->orWhereHas('enrollment', function ($q) use ($searchTerm) { |
|
| 54 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
| 52 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
| 53 | + $query->orWhereHas('enrollment', function($q) use ($searchTerm) { |
|
| 54 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
| 55 | 55 | $q->where('lastname', 'like', '%'.$searchTerm.'%'); |
| 56 | 56 | }); |
| 57 | 57 | }); |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | 'attribute' => 'firstname', |
| 65 | 65 | 'label' => __('First Name'), |
| 66 | 66 | 'type' => 'relationship', |
| 67 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
| 68 | - $query->orWhereHas('enrollment', function ($q) use ($searchTerm) { |
|
| 69 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
| 67 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
| 68 | + $query->orWhereHas('enrollment', function($q) use ($searchTerm) { |
|
| 69 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
| 70 | 70 | $q->where('firstname', 'like', '%'.$searchTerm.'%'); |
| 71 | 71 | }); |
| 72 | 72 | }); |
@@ -80,9 +80,9 @@ discard block |
||
| 80 | 80 | 'attribute' => 'email', |
| 81 | 81 | 'label' => __('Email'), |
| 82 | 82 | 'type' => 'relationship', |
| 83 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
| 84 | - $query->orWhereHas('enrollment', function ($q) use ($searchTerm) { |
|
| 85 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
| 83 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
| 84 | + $query->orWhereHas('enrollment', function($q) use ($searchTerm) { |
|
| 85 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
| 86 | 86 | $q->where('email', 'like', '%'.$searchTerm.'%'); |
| 87 | 87 | }); |
| 88 | 88 | }); |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | 'name' => 'status_id', |
| 113 | 113 | 'type' => 'select2', |
| 114 | 114 | 'label'=> __('Status'), |
| 115 | - ], function () { |
|
| 115 | + ], function() { |
|
| 116 | 116 | return [ |
| 117 | 117 | 1 => __('Pending'), |
| 118 | 118 | 2 => __('Paid'), |
| 119 | 119 | ]; |
| 120 | 120 | }, |
| 121 | - function ($value) { // if the filter is active |
|
| 121 | + function($value) { // if the filter is active |
|
| 122 | 122 | CRUD::addClause('status', $value); |
| 123 | 123 | }); |
| 124 | 124 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | public function scopeStatus(Builder $query, $status) |
| 64 | 64 | { |
| 65 | - return match ($status) { |
|
| 65 | + return match($status) { |
|
| 66 | 66 | "2" => $query->where('status', 2)->orWhereHas('invoices'), |
| 67 | 67 | "1" => $query->where('status', 1)->orWhereDoesntHave('invoices'), |
| 68 | 68 | default => $query, |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | if (config('app.currency_position') === 'before') |
| 113 | 113 | { |
| 114 | - return config('app.currency_symbol') . " ". $this->value; |
|
| 114 | + return config('app.currency_symbol')." ".$this->value; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - return $this->value . " " . config('app.currency_symbol'); |
|
| 117 | + return $this->value." ".config('app.currency_symbol'); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | function getDateForHumansAttribute() |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | public function identifiableAttribute() |
| 142 | 142 | { |
| 143 | - return $this->date . " (" . $this->value_with_currency . ")"; |
|
| 143 | + return $this->date." (".$this->value_with_currency.")"; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | public function getStatusTypeNameAttribute() |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | public function skills() |
| 311 | 311 | { |
| 312 | - return $this->evaluationType?->skills()->orderBy('order'); |
|
| 312 | + return $this->evaluationType ? ->skills()->orderBy('order'); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | public function books() |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | public function getPendingAttendanceAttribute() |
| 336 | 336 | { |
| 337 | - $events = Event::where(function ($query) { |
|
| 337 | + $events = Event::where(function($query) { |
|
| 338 | 338 | $query->where('course_id', $this->id); |
| 339 | 339 | $query->where('exempt_attendance', '!=', true); |
| 340 | 340 | $query->where('exempt_attendance', '!=', 1); |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | foreach ($courseTimes as $courseTime) { |
| 472 | 472 | $initial = $daysInitials[$courseTime->day]; |
| 473 | 473 | |
| 474 | - if (! isset($parsedCourseTimes[$initial])) { |
|
| 474 | + if (!isset($parsedCourseTimes[$initial])) { |
|
| 475 | 475 | $parsedCourseTimes[$initial] = []; |
| 476 | 476 | } |
| 477 | 477 | |
@@ -507,12 +507,12 @@ discard block |
||
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | // handle for case Mon - Friday 9:00am - 5:00pm but on the Wed 10:00am - 2:00pm, so will split up like so [Mon - Tue 9:00am - 5:00pm | Wed 10:00am -2:00pm | Thur - Friday 9:00am - 5:00pm] |
| 510 | - $result = collect($parsed)->map(function ($value) { |
|
| 510 | + $result = collect($parsed)->map(function($value) { |
|
| 511 | 511 | $value = collect($value); |
| 512 | 512 | $day = $value->first()['day']; |
| 513 | 513 | $times = $value->first()['time']; |
| 514 | 514 | if ($value->count() > 1) { |
| 515 | - $day .= ' - ' . $value->last()['day']; |
|
| 515 | + $day .= ' - '.$value->last()['day']; |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | return "$day $times"; |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | public function getCourseTeacherNameAttribute() |
| 549 | 549 | { |
| 550 | 550 | if ($this->teacher_id) { |
| 551 | - return $this->teacher?->name; |
|
| 551 | + return $this->teacher ? ->name; |
|
| 552 | 552 | } else { |
| 553 | 553 | return '-'; |
| 554 | 554 | } |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | |
| 562 | 562 | public function getDescriptionAttribute() |
| 563 | 563 | { |
| 564 | - return '[' . $this->course_period_name . '] - ' . $this->name; |
|
| 564 | + return '['.$this->course_period_name.'] - '.$this->name; |
|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | public function getChildrenCountAttribute() |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | |
| 583 | 583 | public function getAcceptsNewStudentsAttribute(): bool |
| 584 | 584 | { |
| 585 | - if (! $this->spots || $this->spots == 0) { |
|
| 585 | + if (!$this->spots || $this->spots == 0) { |
|
| 586 | 586 | return true; |
| 587 | 587 | } |
| 588 | 588 | |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | |
| 606 | 606 | public function eventsWithExpectedAttendance() |
| 607 | 607 | { |
| 608 | - return $this->events()->where(function ($query) { |
|
| 608 | + return $this->events()->where(function($query) { |
|
| 609 | 609 | $query->where('exempt_attendance', '!=', true); |
| 610 | 610 | $query->where('exempt_attendance', '!=', 1); |
| 611 | 611 | $query->orWhereNull('exempt_attendance'); |
@@ -634,10 +634,10 @@ discard block |
||
| 634 | 634 | { |
| 635 | 635 | if (config('app.currency_position') === 'before') |
| 636 | 636 | { |
| 637 | - return config('app.currency_symbol') . " ". $this->price; |
|
| 637 | + return config('app.currency_symbol')." ".$this->price; |
|
| 638 | 638 | } |
| 639 | 639 | |
| 640 | - return $this->price . " " . config('app.currency_symbol'); |
|
| 640 | + return $this->price." ".config('app.currency_symbol'); |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | |