@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | public function get() |
12 | 12 | { |
13 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
13 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
14 | 14 | abort(403); |
15 | 15 | } |
16 | 16 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | public function update(UpdateConfigRequest $request) |
25 | 25 | { |
26 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
26 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
27 | 27 | abort(403); |
28 | 28 | } |
29 | 29 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | // if the sync with external mailing system is enabled |
20 | 20 | if (config('mailing-system.external_mailing_enabled') == true) { |
21 | 21 | |
22 | - match ($request->input('status')) { |
|
22 | + match($request->input('status')) { |
|
23 | 23 | 1 => $listId = config('mailing-system.mailerlite.activeStudentsListId'), |
24 | 24 | 2, 3 => $listId = config('mailing-system.mailerlite.inactiveStudentsListId'), |
25 | 25 | default => abort(422, 'List ID not found'), |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $report_end_date = $request->report_end_date ? Carbon::parse($request->report_end_date) : Carbon::parse($period->end); |
33 | 33 | |
34 | 34 | // if we are dealing with a complete period, add theoretical volumes |
35 | - if (! $request->report_start_date && ! $request->report_end_date) { |
|
35 | + if (!$request->report_start_date && !$request->report_end_date) { |
|
36 | 36 | // ensure the report end date is not before the end date to avoid inconsistent results. |
37 | 37 | $report_end_date = $report_start_date->max($report_end_date); |
38 | 38 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // foreach partner with an alert set for this day of month |
33 | 33 | foreach (Partner::where('send_report_on', Carbon::now()->day)->get() as $partner) { |
34 | 34 | // get all courses |
35 | - $courses = $partner->courses()->whereHas('events', function (Builder $query) use ($period_start, $period_end) { |
|
35 | + $courses = $partner->courses()->whereHas('events', function(Builder $query) use ($period_start, $period_end) { |
|
36 | 36 | $query->where('start', '>=', $period_start->toDateString())->where('end', '<=', $period_end->toDateString()); |
37 | 37 | }) |
38 | 38 | ->with('events')->withCount('events') |
@@ -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); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $this->crud->allowAccess(['showstudentphotoroster']); |
33 | 33 | $this->crud->setOperationSetting('setFromDb', true); |
34 | 34 | |
35 | - $this->crud->operation('showstudentphotoroster', function () { |
|
35 | + $this->crud->operation('showstudentphotoroster', function() { |
|
36 | 36 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
37 | 37 | }); |
38 | 38 |
@@ -52,11 +52,11 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | View::composer( |
55 | - ['partials.create_new_contact', 'students.edit-contact'], function ($view) { |
|
55 | + ['partials.create_new_contact', 'students.edit-contact'], function($view) { |
|
56 | 56 | $view->with('contact_types', ContactRelationship::all()); |
57 | 57 | }); |
58 | 58 | |
59 | - View::composer('partials.add_book_to_student', function ($view) { |
|
59 | + View::composer('partials.add_book_to_student', function($view) { |
|
60 | 60 | $view->with('books', Book::all()); |
61 | 61 | $view->with('statuses', EnrollmentStatusType::all()); |
62 | 62 | }); |
@@ -30,69 +30,69 @@ |
||
30 | 30 | * a user is allowed to edit the course grades if they are the teacher for this course, |
31 | 31 | * or if they have explicit permission to do so |
32 | 32 | */ |
33 | - Gate::define('edit-course-grades', fn ($user, $course) => $user->isTeacher() && $user->teacher_id == $course->teacher_id || $user->can('evaluation.edit')); |
|
33 | + Gate::define('edit-course-grades', fn($user, $course) => $user->isTeacher() && $user->teacher_id == $course->teacher_id || $user->can('evaluation.edit')); |
|
34 | 34 | |
35 | 35 | /* |
36 | 36 | * a user is allowed to view the course attendance sheet if they are the teacher for this course, |
37 | 37 | * or if they have explicit permission to view all course attendance sheets |
38 | 38 | */ |
39 | - Gate::define('view-course-attendance', fn ($user, $course) => $user->isTeacher() && $user->teacher_id == $course->teacher_id || $user->can('attendance.view')); |
|
39 | + Gate::define('view-course-attendance', fn($user, $course) => $user->isTeacher() && $user->teacher_id == $course->teacher_id || $user->can('attendance.view')); |
|
40 | 40 | |
41 | 41 | /* |
42 | 42 | * a user is allowed to view the event attendance sheet if they are the teacher for this event, |
43 | 43 | * if they are the teacher for this course, |
44 | 44 | * or if they have explicit permission to view all event attendance sheets |
45 | 45 | */ |
46 | - Gate::define('view-event-attendance', fn ($user, $event) => ($event->teacher_id == $user->teacher_id) || ($event->course->teacher_id == $user->teacher_id) || $user->can('attendance.view')); |
|
46 | + Gate::define('view-event-attendance', fn($user, $event) => ($event->teacher_id == $user->teacher_id) || ($event->course->teacher_id == $user->teacher_id) || $user->can('attendance.view')); |
|
47 | 47 | |
48 | 48 | /* |
49 | 49 | * a user is allowed to edit an attendance sheet if they are the teacher for the event, |
50 | 50 | * if they are the teacher for the course, |
51 | 51 | * or if they have explicit permission to edit any attendance sheets |
52 | 52 | */ |
53 | - Gate::define('edit-attendance', fn ($user, $event) => ($event->teacher_id == $user->teacher_id) || ($event->course->teacher_id == $user->teacher_id) || $user->can('attendance.edit')); |
|
53 | + Gate::define('edit-attendance', fn($user, $event) => ($event->teacher_id == $user->teacher_id) || ($event->course->teacher_id == $user->teacher_id) || $user->can('attendance.edit')); |
|
54 | 54 | |
55 | 55 | /* |
56 | 56 | * teachers are allowed to view their own calendar, |
57 | 57 | * and users with explicit permission can view all calendars |
58 | 58 | */ |
59 | - Gate::define('view-teacher-calendar', fn ($user, $teacher) => ($user->isTeacher() && $user->teacher_id == $teacher->id) || $user->can('calendars.view')); |
|
59 | + Gate::define('view-teacher-calendar', fn($user, $teacher) => ($user->isTeacher() && $user->teacher_id == $teacher->id) || $user->can('calendars.view')); |
|
60 | 60 | |
61 | 61 | /* |
62 | 62 | * teachers are allowed to view their own courses, |
63 | 63 | * and users with explicit permission can view all courses |
64 | 64 | */ |
65 | - Gate::define('view-course', fn ($user, Course $course) => ($user->isTeacher() && $user->teacher_id == $course->teacher_id) || $user->can('courses.view')); |
|
65 | + Gate::define('view-course', fn($user, Course $course) => ($user->isTeacher() && $user->teacher_id == $course->teacher_id) || $user->can('courses.view')); |
|
66 | 66 | |
67 | 67 | /* |
68 | 68 | * the user is allowed to view the result if they are the student, |
69 | 69 | * if they are a teacher |
70 | 70 | * of if they have explicit permission to view any result |
71 | 71 | */ |
72 | - Gate::define('view-enrollment', fn ($user, $enrollment) => ($user->isStudent() && $user->student_id == $enrollment->student_id) || $user->isTeacher() || $user->can('evaluation.view')); |
|
72 | + Gate::define('view-enrollment', fn($user, $enrollment) => ($user->isStudent() && $user->student_id == $enrollment->student_id) || $user->isTeacher() || $user->can('evaluation.view')); |
|
73 | 73 | |
74 | 74 | /* |
75 | 75 | * if the user is the teacher of the course |
76 | 76 | * of if they have explicit permission to enroll students |
77 | 77 | */ |
78 | - Gate::define('enroll-in-course', fn ($user, $course) => $course->teacher_id == $user->teacher_id || $user->can('enrollments.edit')); |
|
78 | + Gate::define('enroll-in-course', fn($user, $course) => $course->teacher_id == $user->teacher_id || $user->can('enrollments.edit')); |
|
79 | 79 | |
80 | 80 | /* |
81 | 81 | * if the user is a teacher |
82 | 82 | * of if they have explicit permission to enroll students |
83 | 83 | */ |
84 | - Gate::define('enroll-students', fn ($user) => $user->isTeacher() || $user->can('enrollments.edit')); |
|
84 | + Gate::define('enroll-students', fn($user) => $user->isTeacher() || $user->can('enrollments.edit')); |
|
85 | 85 | |
86 | 86 | /* |
87 | 87 | * teachers are allowed to view their own hours, |
88 | 88 | * and users with explicit permission can view all hours |
89 | 89 | */ |
90 | - Gate::define('view-teacher-hours', fn ($user, $teacher) => ($user->isTeacher() && $user->teacher_id == $teacher->id) || $user->can('hr.view')); |
|
90 | + Gate::define('view-teacher-hours', fn($user, $teacher) => ($user->isTeacher() && $user->teacher_id == $teacher->id) || $user->can('hr.view')); |
|
91 | 91 | |
92 | 92 | /* |
93 | 93 | * teachers are allowed to edit results for their own students |
94 | 94 | * as well as users with explicit permission to edit any result |
95 | 95 | */ |
96 | - Gate::define('edit-result', fn ($user, $enrollment) => ($user->isTeacher() && $user->teacher_id == $enrollment->course->teacher_id) || $user->can('evaluation.edit')); |
|
96 | + Gate::define('edit-result', fn($user, $enrollment) => ($user->isTeacher() && $user->teacher_id == $enrollment->course->teacher_id) || $user->can('evaluation.edit')); |
|
97 | 97 | } |
98 | 98 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | $this->hideSensitiveRequestDetails(); |
22 | 22 | |
23 | - Telescope::filter(function (IncomingEntry $entry) { |
|
23 | + Telescope::filter(function(IncomingEntry $entry) { |
|
24 | 24 | if ($this->app->isLocal()) { |
25 | 25 | return true; |
26 | 26 | } |
@@ -61,6 +61,6 @@ discard block |
||
61 | 61 | */ |
62 | 62 | protected function gate() |
63 | 63 | { |
64 | - Gate::define('viewTelescope', fn ($user = null) => backpack_user() && backpack_user()->email === config('app.admin_email')); |
|
64 | + Gate::define('viewTelescope', fn($user = null) => backpack_user() && backpack_user()->email === config('app.admin_email')); |
|
65 | 65 | } |
66 | 66 | } |