@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'entity' => 'teacher', // the method that defines the relationship in your Model |
110 | 110 | 'attribute' => 'name', // foreign key attribute that is shown to user |
111 | 111 | 'model' => \App\Models\Teacher::class, // foreign key model |
112 | - 'searchLogic' => false, |
|
112 | + 'searchLogic' => false, |
|
113 | 113 | ], |
114 | 114 | |
115 | 115 | [ |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | CRUD::addClause('where', 'rhythm_id', $value); |
171 | 171 | }, |
172 | 172 | function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
173 | - } |
|
173 | + } |
|
174 | 174 | ); |
175 | 175 | |
176 | 176 | CRUD::addFilter( |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | CRUD::addClause('where', 'teacher_id', $value); |
187 | 187 | }, |
188 | 188 | function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
189 | - } |
|
189 | + } |
|
190 | 190 | ); |
191 | 191 | |
192 | 192 | CRUD::addFilter( |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | CRUD::addClause('where', 'level_id', $value); |
203 | 203 | }, |
204 | 204 | function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
205 | - } |
|
205 | + } |
|
206 | 206 | ); |
207 | 207 | |
208 | 208 | CRUD::addFilter( |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | CRUD::addClause('where', 'period_id', $value); |
219 | 219 | }, |
220 | 220 | function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
221 | - $period = Period::get_default_period()->id; |
|
222 | - CRUD::addClause('where', 'period_id', $period); |
|
223 | - $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
|
224 | - } |
|
221 | + $period = Period::get_default_period()->id; |
|
222 | + CRUD::addClause('where', 'period_id', $period); |
|
223 | + $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
|
224 | + } |
|
225 | 225 | ); |
226 | 226 | } |
227 | 227 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | CRUD::field('name')->type('text'); |
58 | 58 | |
59 | - CRUD::addfield([ |
|
59 | + CRUD::addfield([ |
|
60 | 60 | 'name' => 'presets', |
61 | 61 | 'label' => __('Course Schedule'), |
62 | 62 | 'type' => 'repeatable', |
@@ -177,14 +177,14 @@ |
||
177 | 177 | return Scholarship::all()->pluck('name', 'id')->toArray(); |
178 | 178 | }, |
179 | 179 | function ($value) { // if the filter is active |
180 | - if ($value == 'all') { |
|
181 | - CRUD::addClause('whereHas', 'scholarships'); |
|
182 | - } else { |
|
183 | - CRUD::addClause('whereHas', 'scholarships', function ($q) use ($value) { |
|
184 | - $q->where('scholarships.id', $value); |
|
185 | - }); |
|
186 | - } |
|
187 | - } |
|
180 | + if ($value == 'all') { |
|
181 | + CRUD::addClause('whereHas', 'scholarships'); |
|
182 | + } else { |
|
183 | + CRUD::addClause('whereHas', 'scholarships', function ($q) use ($value) { |
|
184 | + $q->where('scholarships.id', $value); |
|
185 | + }); |
|
186 | + } |
|
187 | + } |
|
188 | 188 | ); |
189 | 189 | } |
190 | 190 |
@@ -27,9 +27,9 @@ |
||
27 | 27 | { |
28 | 28 | Log::info('launching API'); |
29 | 29 | $response = Http::post(config('lms.apolearn.url') . '/auth.gettoken', [ |
30 | - 'api_key' => $this->apiKey, |
|
31 | - 'username' => config('lms.apolearn.username'), |
|
32 | - 'password' => config('lms.apolearn.password'), |
|
30 | + 'api_key' => $this->apiKey, |
|
31 | + 'username' => config('lms.apolearn.username'), |
|
32 | + 'password' => config('lms.apolearn.password'), |
|
33 | 33 | ]); |
34 | 34 | |
35 | 35 | return $response['result'] ?? ""; |