@@ -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 | }); |
@@ -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 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | public function updateCourse(Course $course) : void |
| 134 | 134 | { |
| 135 | - if (! $course->lms_id) { |
|
| 135 | + if (!$course->lms_id) { |
|
| 136 | 136 | $this->createCourse($course); |
| 137 | 137 | } |
| 138 | 138 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | Log::info('found these teachers IDs on LMS:'.implode(', ', $teachers->pluck('id')->toArray())); |
| 162 | 162 | |
| 163 | 163 | // if the course has no teacher, stop |
| 164 | - if (! $course->teacher) { |
|
| 164 | + if (!$course->teacher) { |
|
| 165 | 165 | Log::alert('The course has no teacher on local system, removing all teachers from remote'); |
| 166 | 166 | foreach ($teachers as $teacher) { |
| 167 | 167 | $this->removeTeacher($course->lms_id, $teacher['id']); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if (! $course->teacher->user->lms_id || ! $teachers->contains('id', $course->teacher->user->lms_id)) { |
|
| 179 | + if (!$course->teacher->user->lms_id || !$teachers->contains('id', $course->teacher->user->lms_id)) { |
|
| 180 | 180 | Log::info('the course teacher has changed, need to update it'); |
| 181 | 181 | $this->addTeacher($course); |
| 182 | 182 | } |
@@ -186,14 +186,14 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | public function enrollStudent(Course $course, Student $student): void |
| 188 | 188 | { |
| 189 | - if (! $course->lms_id) { |
|
| 189 | + if (!$course->lms_id) { |
|
| 190 | 190 | abort(404, 'This course is not synced with external LMS'); |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | $courseId = $course->lms_id; |
| 194 | 194 | |
| 195 | 195 | // if the student is not synced with the LMS, create them |
| 196 | - if (! $student->user->lms_id) { |
|
| 196 | + if (!$student->user->lms_id) { |
|
| 197 | 197 | $this->createUser($student->user); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | // only process if the course has a teacher |
| 217 | 217 | if ($course->teacher_id) { |
| 218 | 218 | // if the teacher doesn't exist on LMS, create them |
| 219 | - if (! $course->teacher->user->lms_id) { |
|
| 219 | + if (!$course->teacher->user->lms_id) { |
|
| 220 | 220 | Log::info('creating user now'); |
| 221 | 221 | $this->createUser($course->teacher->user); |
| 222 | 222 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // get past events for the course |
| 115 | - $events = $course->events->filter(fn ($value, $key) => Carbon::parse($value->start) < Carbon::now())->sortByDesc('start'); |
|
| 115 | + $events = $course->events->filter(fn($value, $key) => Carbon::parse($value->start) < Carbon::now())->sortByDesc('start'); |
|
| 116 | 116 | |
| 117 | 117 | // if the course has any past events |
| 118 | 118 | if (($events->count() == 0) || ($course->enrollments()->count() == 0)) { |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | public function toggleEventAttendanceStatus(Event $event, Request $request) |
| 198 | 198 | { |
| 199 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 199 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 200 | 200 | abort(403); |
| 201 | 201 | } |
| 202 | 202 | $event->exempt_attendance = (int) $request->status; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | public function toggleCourseAttendanceStatus(Course $course, Request $request) |
| 209 | 209 | { |
| 210 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 210 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 211 | 211 | abort(403); |
| 212 | 212 | } |
| 213 | 213 | $course->exempt_attendance = (int) $request->status; |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | 'name' => 'action', |
| 91 | 91 | 'label'=> 'Action', |
| 92 | 92 | ], |
| 93 | - false, |
|
| 94 | - function () { // if the filter is active |
|
| 95 | - CRUD::addClause('where', 'action', true); |
|
| 96 | - }); |
|
| 93 | + false, |
|
| 94 | + function () { // if the filter is active |
|
| 95 | + CRUD::addClause('where', 'action', true); |
|
| 96 | + }); |
|
| 97 | 97 | |
| 98 | 98 | CRUD::addFilter([ // dropdown filter |
| 99 | 99 | 'name' => 'type', |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | ], function ($value) { // if the filter is active |
| 110 | 110 | CRUD::addClause('where', 'commentable_type', '=', $value); |
| 111 | 111 | }, |
| 112 | - function () { // if the filter is not active |
|
| 113 | - CRUD::addClause('where', 'commentable_type', '=', Student::class); |
|
| 114 | - $this->crud->getRequest()->request->add(['commentable_type' => Student::class]); // to make the filter look active |
|
| 115 | - }); |
|
| 112 | + function () { // if the filter is not active |
|
| 113 | + CRUD::addClause('where', 'commentable_type', '=', Student::class); |
|
| 114 | + $this->crud->getRequest()->request->add(['commentable_type' => Student::class]); // to make the filter look active |
|
| 115 | + }); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | public function setupUpdateOperation() |
@@ -85,17 +85,17 @@ discard block |
||
| 85 | 85 | ], |
| 86 | 86 | ]); |
| 87 | 87 | |
| 88 | - CRUD::addFilter([ // simple filter |
|
| 88 | + CRUD::addFilter([// simple filter |
|
| 89 | 89 | 'type' => 'simple', |
| 90 | 90 | 'name' => 'action', |
| 91 | 91 | 'label'=> 'Action', |
| 92 | 92 | ], |
| 93 | 93 | false, |
| 94 | - function () { // if the filter is active |
|
| 94 | + function() { // if the filter is active |
|
| 95 | 95 | CRUD::addClause('where', 'action', true); |
| 96 | 96 | }); |
| 97 | 97 | |
| 98 | - CRUD::addFilter([ // dropdown filter |
|
| 98 | + CRUD::addFilter([// dropdown filter |
|
| 99 | 99 | 'name' => 'type', |
| 100 | 100 | 'type' => 'dropdown', |
| 101 | 101 | 'label'=> 'Type', |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | Invoice::class => 'Invoice', |
| 107 | 107 | Result::class => 'Result', |
| 108 | 108 | |
| 109 | - ], function ($value) { // if the filter is active |
|
| 109 | + ], function($value) { // if the filter is active |
|
| 110 | 110 | CRUD::addClause('where', 'commentable_type', '=', $value); |
| 111 | 111 | }, |
| 112 | - function () { // if the filter is not active |
|
| 112 | + function() { // if the filter is not active |
|
| 113 | 113 | CRUD::addClause('where', 'commentable_type', '=', Student::class); |
| 114 | 114 | $this->crud->getRequest()->request->add(['commentable_type' => Student::class]); // to make the filter look active |
| 115 | 115 | }); |
@@ -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 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | $invoice = Invoice::findOrFail($id)->load('payments'); |
| 96 | 96 | |
| 97 | - if (! backpack_user()->can('enrollments.edit')) { |
|
| 97 | + if (!backpack_user()->can('enrollments.edit')) { |
|
| 98 | 98 | abort(403); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | 'type' => 'relationship', |
| 73 | 73 | 'name' => 'category', // the method on your model that defines the relationship |
| 74 | 74 | 'ajax' => true, |
| 75 | - 'inline_create' => [ // specify the entity in singular |
|
| 75 | + 'inline_create' => [// specify the entity in singular |
|
| 76 | 76 | 'entity' => 'gradetypecategory', // the entity in singular |
| 77 | 77 | // OPTIONALS |
| 78 | 78 | 'force_select' => true, // should the inline-created entry be immediately selected? |
@@ -28,14 +28,14 @@ |
||
| 28 | 28 | protected function setupListOperation() |
| 29 | 29 | { |
| 30 | 30 | CRUD::addColumn(['name' => 'name', 'label' => 'Name']); |
| 31 | - CRUD::addColumn(['name' => 'lms_id', 'label' => 'LMS code', 'type' => 'text'], ); |
|
| 31 | + CRUD::addColumn(['name' => 'lms_id', 'label' => 'LMS code', 'type' => 'text'],); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | protected function setupCreateOperation() |
| 35 | 35 | { |
| 36 | 36 | CRUD::setValidation(StoreRequest::class); |
| 37 | 37 | CRUD::addField(['name' => 'name', 'label' => 'Name', 'type' => 'text']); |
| 38 | - CRUD::addField(['name' => 'lms_id', 'label' => 'LMS code', 'type' => 'text'], ); |
|
| 38 | + CRUD::addField(['name' => 'lms_id', 'label' => 'LMS code', 'type' => 'text'],); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | protected function setupUpdateOperation() |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | 'type' => 'date', |
| 98 | 98 | ]); |
| 99 | 99 | |
| 100 | - CRUD::addField([ // Checkbox |
|
| 100 | + CRUD::addField([// Checkbox |
|
| 101 | 101 | 'name' => 'auto_renewal', |
| 102 | 102 | 'label' => __('Tacit renewal'), |
| 103 | 103 | 'type' => 'checkbox', |