@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $year_data = []; |
63 | 63 | $years = []; // New array |
64 | 64 | |
65 | - if (! isset($request->period)) { |
|
65 | + if (!isset($request->period)) { |
|
66 | 66 | $startperiod = Period::find(Config::where('name', 'first_external_period')->first()->value ?? Period::first()->id); |
67 | 67 | } else { |
68 | 68 | $startperiod = Period::find($request->period); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | { |
164 | 164 | $period = Period::get_default_period(); |
165 | 165 | |
166 | - if (! isset($request->period)) { |
|
166 | + if (!isset($request->period)) { |
|
167 | 167 | $startperiod = Period::find(Config::where('name', 'first_period')->first()->value); |
168 | 168 | } else { |
169 | 169 | $startperiod = Period::find($request->period); |
@@ -239,10 +239,10 @@ discard block |
||
239 | 239 | CRUD::addClause('where', 'period_id', $value); |
240 | 240 | }, |
241 | 241 | function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
242 | - $period = \App\Models\Period::get_default_period()->id; |
|
243 | - CRUD::addClause('where', 'period_id', $period); |
|
244 | - $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
|
245 | - } |
|
242 | + $period = \App\Models\Period::get_default_period()->id; |
|
243 | + CRUD::addClause('where', 'period_id', $period); |
|
244 | + $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
|
245 | + } |
|
246 | 246 | ); |
247 | 247 | |
248 | 248 | CRUD::addFilter( |
@@ -253,8 +253,8 @@ discard block |
||
253 | 253 | ], |
254 | 254 | false, |
255 | 255 | function () { |
256 | - CRUD::addClause('parent'); |
|
257 | - } |
|
256 | + CRUD::addClause('parent'); |
|
257 | + } |
|
258 | 258 | ); |
259 | 259 | |
260 | 260 | $this->crud->addFilter([ |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | 'type' => 'number' |
381 | 381 | ], $currency), |
382 | 382 | |
383 | - [ |
|
383 | + [ |
|
384 | 384 | 'name' => 'volume', // The db column name |
385 | 385 | 'label' => __('Presential volume'), // Table column heading |
386 | 386 | 'suffix' => 'h', |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | CRUD::addClause('internal'); |
57 | 57 | $permissions = backpack_user()->getAllPermissions(); |
58 | 58 | |
59 | - if (! $permissions->contains('name', 'courses.edit')) { |
|
59 | + if (!$permissions->contains('name', 'courses.edit')) { |
|
60 | 60 | CRUD::denyAccess(['update', 'create']); |
61 | 61 | } |
62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | CRUD::addButtonFromView('line', 'children_badge', 'children_badge', 'beginning'); |
68 | 68 | |
69 | - if (! $permissions->contains('name', 'courses.delete')) { |
|
69 | + if (!$permissions->contains('name', 'courses.delete')) { |
|
70 | 70 | CRUD::denyAccess(['delete']); |
71 | 71 | } |
72 | 72 | |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | 'name' => 'rhythm_id', |
189 | 189 | 'type' => 'select2', |
190 | 190 | 'label'=> __('Rhythm'), |
191 | - ], function () { |
|
191 | + ], function() { |
|
192 | 192 | return Rhythm::all()->pluck('name', 'id')->toArray(); |
193 | - }, function ($value) { |
|
193 | + }, function($value) { |
|
194 | 194 | // if the filter is active |
195 | 195 | CRUD::addClause('where', 'rhythm_id', $value); |
196 | 196 | }, |
197 | - function () { |
|
197 | + function() { |
|
198 | 198 | // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
199 | 199 | }); |
200 | 200 | |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | 'name' => 'teacher_id', |
203 | 203 | 'type' => 'select2', |
204 | 204 | 'label'=> __('Teacher'), |
205 | - ], function () { |
|
205 | + ], function() { |
|
206 | 206 | return Teacher::all()->pluck('name', 'id')->toArray(); |
207 | - }, function ($value) { |
|
207 | + }, function($value) { |
|
208 | 208 | // if the filter is active |
209 | 209 | CRUD::addClause('where', 'teacher_id', $value); |
210 | 210 | }, |
211 | - function () { |
|
211 | + function() { |
|
212 | 212 | // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
213 | 213 | }); |
214 | 214 | |
@@ -216,13 +216,13 @@ discard block |
||
216 | 216 | 'name' => 'level_id', |
217 | 217 | 'type' => 'select2', |
218 | 218 | 'label'=> __('Level'), |
219 | - ], function () { |
|
219 | + ], function() { |
|
220 | 220 | return Level::all()->pluck('name', 'id')->toArray(); |
221 | - }, function ($value) { |
|
221 | + }, function($value) { |
|
222 | 222 | // if the filter is active |
223 | 223 | CRUD::addClause('where', 'level_id', $value); |
224 | 224 | }, |
225 | - function () { |
|
225 | + function() { |
|
226 | 226 | // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
227 | 227 | }); |
228 | 228 | |
@@ -231,13 +231,13 @@ discard block |
||
231 | 231 | 'type' => 'select2', |
232 | 232 | 'label'=> __('Period'), |
233 | 233 | ], |
234 | - function () { |
|
234 | + function() { |
|
235 | 235 | return \App\Models\Period::all()->sortByDesc('id')->pluck('name', 'id')->toArray(); |
236 | 236 | }, |
237 | - function ($value) { // if the filter is active |
|
237 | + function($value) { // if the filter is active |
|
238 | 238 | CRUD::addClause('where', 'period_id', $value); |
239 | 239 | }, |
240 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
240 | + function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
241 | 241 | $period = \App\Models\Period::get_default_period()->id; |
242 | 242 | CRUD::addClause('where', 'period_id', $period); |
243 | 243 | $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
@@ -245,13 +245,13 @@ discard block |
||
245 | 245 | ); |
246 | 246 | |
247 | 247 | CRUD::addFilter( |
248 | - [ // add a "simple" filter called Draft |
|
248 | + [// add a "simple" filter called Draft |
|
249 | 249 | 'type' => 'simple', |
250 | 250 | 'name' => 'parent', |
251 | 251 | 'label'=> __('Hide Children Courses'), |
252 | 252 | ], |
253 | 253 | false, |
254 | - function () { |
|
254 | + function() { |
|
255 | 255 | CRUD::addClause('parent'); |
256 | 256 | } |
257 | 257 | ); |
@@ -262,10 +262,10 @@ discard block |
||
262 | 262 | 'label' => __('Start') |
263 | 263 | ], |
264 | 264 | false, |
265 | - function ($value) { // if the filter is active, apply these constraints |
|
265 | + function($value) { // if the filter is active, apply these constraints |
|
266 | 266 | $dates = json_decode($value); |
267 | 267 | $this->crud->addClause('where', 'start_date', '>=', $dates->from); |
268 | - $this->crud->addClause('where', 'start_date', '<=', $dates->to . ' 23:59:59'); |
|
268 | + $this->crud->addClause('where', 'start_date', '<=', $dates->to.' 23:59:59'); |
|
269 | 269 | }); |
270 | 270 | |
271 | 271 | $this->crud->addFilter([ |
@@ -274,10 +274,10 @@ discard block |
||
274 | 274 | 'label' => __('End') |
275 | 275 | ], |
276 | 276 | false, |
277 | - function ($value) { // if the filter is active, apply these constraints |
|
277 | + function($value) { // if the filter is active, apply these constraints |
|
278 | 278 | $dates = json_decode($value); |
279 | 279 | $this->crud->addClause('where', 'end_date', '>=', $dates->from); |
280 | - $this->crud->addClause('where', 'end_date', '<=', $dates->to . ' 23:59:59'); |
|
280 | + $this->crud->addClause('where', 'end_date', '<=', $dates->to.' 23:59:59'); |
|
281 | 281 | }); |
282 | 282 | } |
283 | 283 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | ], |
354 | 354 | |
355 | 355 | |
356 | - [ // repeatable |
|
356 | + [// repeatable |
|
357 | 357 | 'name' => 'sublevels', |
358 | 358 | 'label' => __('Course sublevels'), |
359 | 359 | 'type' => 'repeatable', |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | 'default' => Period::get_enrollments_period()->end, |
511 | 511 | ], |
512 | 512 | |
513 | - [ // repeatable |
|
513 | + [// repeatable |
|
514 | 514 | 'name' => 'times', |
515 | 515 | 'label' => __('Course Schedule'), |
516 | 516 | 'type' => 'repeatable', |
@@ -573,14 +573,14 @@ discard block |
||
573 | 573 | 'init_rows' => 0, // number of empty rows to be initialized, by default 1 |
574 | 574 | ], |
575 | 575 | |
576 | - [ // view |
|
576 | + [// view |
|
577 | 577 | 'name' => 'custom-ajax-button', |
578 | 578 | 'type' => 'view', |
579 | 579 | 'view' => 'courses/schedule-preset-alert', |
580 | 580 | 'tab' => __('Schedule'), |
581 | 581 | ], |
582 | 582 | |
583 | - [ // select_from_array |
|
583 | + [// select_from_array |
|
584 | 584 | 'name' => 'schedulepreset', |
585 | 585 | 'label' => __('Schedule Preset'), |
586 | 586 | 'type' => 'select_from_array', |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | } |
605 | 605 | |
606 | 606 | if ($this->crud->getCurrentEntry()->children->count() > 0) { |
607 | - CRUD::addField([ // view |
|
607 | + CRUD::addField([// view |
|
608 | 608 | 'name' => 'custom-ajax-button', |
609 | 609 | 'type' => 'view', |
610 | 610 | 'view' => 'courses/parent-course-alert' |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | } |
613 | 613 | |
614 | 614 | if ($this->crud->getCurrentEntry()->parent_course_id !== null) { |
615 | - CRUD::addField([ // view |
|
615 | + CRUD::addField([// view |
|
616 | 616 | 'name' => 'custom-ajax-button', |
617 | 617 | 'type' => 'view', |
618 | 618 | 'view' => 'courses/child-course-alert' |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | 'attribute' => 'lastname', // foreign key attribute that is shown to user |
49 | 49 | 'model' => 'App\Models\User', // foreign key model |
50 | 50 | 'orderable' => true, |
51 | - 'orderLogic' => function ($query, $column, $columnDirection) { |
|
51 | + 'orderLogic' => function($query, $column, $columnDirection) { |
|
52 | 52 | return $query->leftJoin('users', 'users.id', '=', 'students.id') |
53 | 53 | ->orderBy('users.lastname', $columnDirection)->select('students.*'); |
54 | 54 | }, |
55 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
56 | - $query->orWhereHas('user', function ($q) use ($searchTerm) { |
|
55 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
56 | + $query->orWhereHas('user', function($q) use ($searchTerm) { |
|
57 | 57 | $q->where('lastname', 'like', '%'.$searchTerm.'%'); |
58 | 58 | }); |
59 | 59 | }, |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | 'attribute' => 'firstname', // foreign key attribute that is shown to user |
69 | 69 | 'model' => 'App\Models\User', // foreign key model |
70 | 70 | 'orderable' => true, |
71 | - 'orderLogic' => function ($query, $column, $columnDirection) { |
|
71 | + 'orderLogic' => function($query, $column, $columnDirection) { |
|
72 | 72 | return $query->leftJoin('users', 'users.id', '=', 'teachers.id') |
73 | 73 | ->orderBy('users.firstname', $columnDirection)->select('teachers.*'); |
74 | 74 | }, |
75 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
76 | - $query->orWhereHas('user', function ($q) use ($searchTerm) { |
|
75 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
76 | + $query->orWhereHas('user', function($q) use ($searchTerm) { |
|
77 | 77 | $q->where('firstname', 'like', '%'.$searchTerm.'%'); |
78 | 78 | }); |
79 | 79 | }, |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | 'attribute' => 'email', // foreign key attribute that is shown to user |
88 | 88 | 'model' => 'App\Models\User', // foreign key model |
89 | 89 | 'orderable' => true, |
90 | - 'orderLogic' => function ($query, $column, $columnDirection) { |
|
90 | + 'orderLogic' => function($query, $column, $columnDirection) { |
|
91 | 91 | return $query->leftJoin('users', 'users.id', '=', 'teachers.id') |
92 | 92 | ->orderBy('users.email', $columnDirection)->select('teachers.*'); |
93 | 93 | }, |
94 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
95 | - $query->orWhereHas('user', function ($q) use ($searchTerm) { |
|
94 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
95 | + $query->orWhereHas('user', function($q) use ($searchTerm) { |
|
96 | 96 | $q->where('email', 'like', '%'.$searchTerm.'%'); |
97 | 97 | }); |
98 | 98 | }, |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $username = $request->email; |
167 | 167 | } |
168 | 168 | else { |
169 | - $username = $this->generateUsername($request->firstname . ' ' . $request->lastname); |
|
169 | + $username = $this->generateUsername($request->firstname.' '.$request->lastname); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | $user = User::create([ |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | $username_parts = array_filter(explode(" ", strtolower($fullName))); |
192 | 192 | $username_parts = array_slice($username_parts, -2); |
193 | 193 | |
194 | - $part1 = (!empty($username_parts[0]))?substr($username_parts[0], 0,3):""; |
|
195 | - $part2 = (!empty($username_parts[1]))?substr($username_parts[1], 0,8):""; |
|
194 | + $part1 = (!empty($username_parts[0])) ?substr($username_parts[0], 0, 3) : ""; |
|
195 | + $part2 = (!empty($username_parts[1])) ?substr($username_parts[1], 0, 8) : ""; |
|
196 | 196 | $part3 = rand(999, 9999); |
197 | 197 | |
198 | - $username = $part1. $part2. $part3; //str_shuffle to randomly shuffle all characters |
|
198 | + $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters |
|
199 | 199 | |
200 | 200 | return $username; |
201 | 201 | } |
@@ -164,8 +164,7 @@ |
||
164 | 164 | if (User::where('email', $request->email)->count() === 0) |
165 | 165 | { |
166 | 166 | $username = $request->email; |
167 | - } |
|
168 | - else { |
|
167 | + } else { |
|
169 | 168 | $username = $this->generateUsername($request->firstname . ' ' . $request->lastname); |
170 | 169 | } |
171 | 170 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function setup() |
28 | 28 | { |
29 | 29 | CRUD::setModel(\App\Models\Config::class); |
30 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/config'); |
|
30 | + CRUD::setRoute(config('backpack.base.route_prefix').'/config'); |
|
31 | 31 | CRUD::setEntityNameStrings('config', 'configs'); |
32 | 32 | } |
33 | 33 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function setup() |
33 | 33 | { |
34 | 34 | CRUD::setModel(\App\Models\Invoice::class); |
35 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/invoice'); |
|
35 | + CRUD::setRoute(config('backpack.base.route_prefix').'/invoice'); |
|
36 | 36 | CRUD::setEntityNameStrings('invoice', 'invoices'); |
37 | 37 | $this->crud->addButtonFromView('top', 'createInvoice', 'createInvoice', 'start'); |
38 | 38 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | $invoice = Invoice::findOrFail($id)->load('payments'); |
103 | 103 | |
104 | - if (! backpack_user()->can('enrollments.edit')) { |
|
104 | + if (!backpack_user()->can('enrollments.edit')) { |
|
105 | 105 | abort(403); |
106 | 106 | } |
107 | 107 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $q->where('firstname', 'like', '%'.$searchTerm.'%') |
55 | 55 | ->orWhere('lastname', 'like', '%'.$searchTerm.'%') |
56 | 56 | ->orWhere('email', 'like', '%'.$searchTerm.'%') |
57 | - ->orWhere('idnumber', 'like', '%'.$searchTerm.'%'); |
|
57 | + ->orWhere('idnumber', 'like', '%'.$searchTerm.'%'); |
|
58 | 58 | }); |
59 | 59 | }); |
60 | 60 | }, |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | 'name' => 'noresult', |
89 | 89 | 'label'=> __('No Result'), |
90 | 90 | ], |
91 | - false, |
|
92 | - function () { |
|
93 | - CRUD::addClause('noResult'); |
|
94 | - } |
|
91 | + false, |
|
92 | + function () { |
|
93 | + CRUD::addClause('noResult'); |
|
94 | + } |
|
95 | 95 | ); |
96 | 96 | |
97 | 97 | CRUD::addFilter( |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | ], |
103 | 103 | false, |
104 | 104 | function () { |
105 | - CRUD::addClause('real'); |
|
106 | - } |
|
105 | + CRUD::addClause('real'); |
|
106 | + } |
|
107 | 107 | ); |
108 | 108 | |
109 | 109 | CRUD::addFilter([ |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | 'type' => 'select', |
49 | 49 | 'name' => 'student', // the method that defines the relationship in your Model |
50 | 50 | 'attribute' => 'name', // foreign key attribute that is shown to user |
51 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
52 | - $query->orWhereHas('student', function ($q) use ($searchTerm) { |
|
53 | - $q->WhereHas('user', function ($q) use ($searchTerm) { |
|
51 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
52 | + $query->orWhereHas('student', function($q) use ($searchTerm) { |
|
53 | + $q->WhereHas('user', function($q) use ($searchTerm) { |
|
54 | 54 | $q->where('firstname', 'like', '%'.$searchTerm.'%') |
55 | 55 | ->orWhere('lastname', 'like', '%'.$searchTerm.'%') |
56 | 56 | ->orWhere('email', 'like', '%'.$searchTerm.'%') |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'label'=> __('No Result'), |
90 | 90 | ], |
91 | 91 | false, |
92 | - function () { |
|
92 | + function() { |
|
93 | 93 | CRUD::addClause('noResult'); |
94 | 94 | } |
95 | 95 | ); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | 'label'=> __('Hide Parents'), |
102 | 102 | ], |
103 | 103 | false, |
104 | - function () { |
|
104 | + function() { |
|
105 | 105 | CRUD::addClause('real'); |
106 | 106 | } |
107 | 107 | ); |
@@ -110,20 +110,20 @@ discard block |
||
110 | 110 | 'name' => 'period_id', |
111 | 111 | 'type' => 'select2', |
112 | 112 | 'label'=> __('Period'), |
113 | - ], function () { |
|
113 | + ], function() { |
|
114 | 114 | return Period::all()->pluck('name', 'id')->toArray(); |
115 | - }, function ($value) { // if the filter is active |
|
115 | + }, function($value) { // if the filter is active |
|
116 | 116 | CRUD::addClause('period', $value); |
117 | 117 | }); |
118 | 118 | |
119 | - CRUD::addFilter([ // select2_multiple filter |
|
119 | + CRUD::addFilter([// select2_multiple filter |
|
120 | 120 | 'name' => 'result', |
121 | 121 | 'type' => 'select2', |
122 | 122 | 'label'=> __('Result'), |
123 | - ], function () { // the options that show up in the select2 |
|
123 | + ], function() { // the options that show up in the select2 |
|
124 | 124 | return ResultType::all()->pluck('name', 'id')->toArray(); |
125 | - }, function ($value) { // if the filter is active |
|
126 | - $this->crud->query = $this->crud->query->whereHas('result', function ($query) use ($value) { |
|
125 | + }, function($value) { // if the filter is active |
|
126 | + $this->crud->query = $this->crud->query->whereHas('result', function($query) use ($value) { |
|
127 | 127 | $query->where('result_type_id', $value); |
128 | 128 | }); |
129 | 129 | }); |
@@ -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 |
@@ -158,66 +158,66 @@ discard block |
||
158 | 158 | ]); |
159 | 159 | |
160 | 160 | CRUD::addFilter( |
161 | - [ // select2 filter |
|
161 | + [// select2 filter |
|
162 | 162 | 'name' => 'rhythm_id', |
163 | 163 | 'type' => 'select2', |
164 | 164 | 'label'=> __('Rhythm'), |
165 | 165 | ], |
166 | - function () { |
|
166 | + function() { |
|
167 | 167 | return \App\Models\Rhythm::all()->pluck('name', 'id')->toArray(); |
168 | 168 | }, |
169 | - function ($value) { // if the filter is active |
|
169 | + function($value) { // if the filter is active |
|
170 | 170 | CRUD::addClause('where', 'rhythm_id', $value); |
171 | 171 | }, |
172 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
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( |
177 | - [ // select2 filter |
|
177 | + [// select2 filter |
|
178 | 178 | 'name' => 'teacher_id', |
179 | 179 | 'type' => 'select2', |
180 | 180 | 'label'=> __('Teacher'), |
181 | 181 | ], |
182 | - function () { |
|
182 | + function() { |
|
183 | 183 | return \App\Models\Teacher::all()->pluck('name', 'id')->toArray(); |
184 | 184 | }, |
185 | - function ($value) { // if the filter is active |
|
185 | + function($value) { // if the filter is active |
|
186 | 186 | CRUD::addClause('where', 'teacher_id', $value); |
187 | 187 | }, |
188 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
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( |
193 | - [ // select2 filter |
|
193 | + [// select2 filter |
|
194 | 194 | 'name' => 'level_id', |
195 | 195 | 'type' => 'select2', |
196 | 196 | 'label'=> __('Level'), |
197 | 197 | ], |
198 | - function () { |
|
198 | + function() { |
|
199 | 199 | return \App\Models\Level::all()->pluck('name', 'id')->toArray(); |
200 | 200 | }, |
201 | - function ($value) { // if the filter is active |
|
201 | + function($value) { // if the filter is active |
|
202 | 202 | CRUD::addClause('where', 'level_id', $value); |
203 | 203 | }, |
204 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
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( |
209 | - [ // select2 filter |
|
209 | + [// select2 filter |
|
210 | 210 | 'name' => 'period_id', |
211 | 211 | 'type' => 'select2', |
212 | 212 | 'label'=> __('Period'), |
213 | 213 | ], |
214 | - function () { |
|
214 | + function() { |
|
215 | 215 | return Period::all()->pluck('name', 'id')->toArray(); |
216 | 216 | }, |
217 | - function ($value) { // if the filter is active |
|
217 | + function($value) { // if the filter is active |
|
218 | 218 | CRUD::addClause('where', 'period_id', $value); |
219 | 219 | }, |
220 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
220 | + function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
221 | 221 | $period = Period::get_default_period()->id; |
222 | 222 | CRUD::addClause('where', 'period_id', $period); |
223 | 223 | $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | 'tab' => __('Course info'), |
364 | 364 | ], |
365 | 365 | |
366 | - [ // repeatable |
|
366 | + [// repeatable |
|
367 | 367 | 'name' => 'times', |
368 | 368 | 'label' => __('Course Schedule'), |
369 | 369 | 'type' => 'repeatable', |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | 'tab' => __('Schedule'), |
403 | 403 | ], |
404 | 404 | |
405 | - [ // view |
|
405 | + [// view |
|
406 | 406 | 'name' => 'custom-ajax-button', |
407 | 407 | 'type' => 'view', |
408 | 408 | 'view' => 'courses/schedule-preset-alert', |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | 'tab' => __('Course info'), |
557 | 557 | ], |
558 | 558 | |
559 | - [ // repeatable |
|
559 | + [// repeatable |
|
560 | 560 | 'name' => 'times', |
561 | 561 | 'label' => __('Course Schedule'), |
562 | 562 | 'type' => 'repeatable', |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function setup() |
36 | 36 | { |
37 | 37 | CRUD::setModel(\App\Models\Payment::class); |
38 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/payment'); |
|
38 | + CRUD::setRoute(config('backpack.base.route_prefix').'/payment'); |
|
39 | 39 | CRUD::setEntityNameStrings('payment', 'payments'); |
40 | 40 | |
41 | 41 | $this->crud->enableExportButtons(); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'label' => __('Due Date'), |
55 | 55 | ], |
56 | 56 | false, |
57 | - function ($value) { // if the filter is active, apply these constraints |
|
57 | + function($value) { // if the filter is active, apply these constraints |
|
58 | 58 | $this->crud->addClause('where', 'date', '>=', Carbon::parse($value)->firstOfMonth()); |
59 | 59 | $this->crud->addClause('where', 'date', '<=', Carbon::parse($value)->lastOfMonth()); |
60 | 60 | }); |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | { |
96 | 96 | $payment = Payment::findOrFail($id); |
97 | 97 | |
98 | - if (! backpack_user()->can('enrollments.edit')) { |
|
98 | + if (!backpack_user()->can('enrollments.edit')) { |
|
99 | 99 | abort(403); |
100 | 100 | } |
101 | 101 | |
102 | - if (! $payment->invoice) |
|
102 | + if (!$payment->invoice) |
|
103 | 103 | { |
104 | 104 | abort(404, 'No enrollment found for this payment'); |
105 | 105 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | 'type' => "relationship", |
76 | 76 | 'name' => 'category', // the method on your model that defines the relationship |
77 | 77 | 'ajax' => true, |
78 | - 'inline_create' => [ // specify the entity in singular |
|
78 | + 'inline_create' => [// specify the entity in singular |
|
79 | 79 | 'entity' => 'gradetypecategory', // the entity in singular |
80 | 80 | // OPTIONALS |
81 | 81 | 'force_select' => true, // should the inline-created entry be immediately selected? |