@@ -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 | }); |
@@ -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? |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function setup() |
28 | 28 | { |
29 | 29 | CRUD::setModel(\App\Models\SchedulePreset::class); |
30 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/schedulepreset'); |
|
30 | + CRUD::setRoute(config('backpack.base.route_prefix').'/schedulepreset'); |
|
31 | 31 | CRUD::setEntityNameStrings('Schedule Preset', 'Schedule Presets'); |
32 | 32 | } |
33 | 33 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | public function setup() |
27 | 27 | { |
28 | 28 | CRUD::setModel(\App\Models\Profession::class); |
29 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/profession'); |
|
29 | + CRUD::setRoute(config('backpack.base.route_prefix').'/profession'); |
|
30 | 30 | CRUD::setEntityNameStrings('profession', 'professions'); |
31 | 31 | } |
32 | 32 |
@@ -86,17 +86,17 @@ discard block |
||
86 | 86 | ], |
87 | 87 | ]); |
88 | 88 | |
89 | - CRUD::addFilter([ // simple filter |
|
89 | + CRUD::addFilter([// simple filter |
|
90 | 90 | 'type' => 'simple', |
91 | 91 | 'name' => 'action', |
92 | 92 | 'label'=> 'Action', |
93 | 93 | ], |
94 | 94 | false, |
95 | - function () { // if the filter is active |
|
95 | + function() { // if the filter is active |
|
96 | 96 | CRUD::addClause('where', 'action', true); |
97 | 97 | }); |
98 | 98 | |
99 | - CRUD::addFilter([ // dropdown filter |
|
99 | + CRUD::addFilter([// dropdown filter |
|
100 | 100 | 'name' => 'type', |
101 | 101 | 'type' => 'dropdown', |
102 | 102 | 'label'=> 'Type', |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | Invoice::class => 'Invoice', |
108 | 108 | Result::class => 'Result', |
109 | 109 | |
110 | - ], function ($value) { // if the filter is active |
|
110 | + ], function($value) { // if the filter is active |
|
111 | 111 | CRUD::addClause('where', 'commentable_type', '=', $value); |
112 | 112 | }, |
113 | - function () { // if the filter is not active |
|
113 | + function() { // if the filter is not active |
|
114 | 114 | CRUD::addClause('where', 'commentable_type', '=', Student::class); |
115 | 115 | $this->crud->getRequest()->request->add(['commentable_type' => Student::class]); // to make the filter look active |
116 | 116 | }); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | 'label' => trans('backpack::permissionmanager.email'), |
48 | 48 | 'type' => 'email', |
49 | 49 | ], |
50 | - [ // n-n relationship (with pivot table) |
|
50 | + [// n-n relationship (with pivot table) |
|
51 | 51 | 'label' => trans('backpack::permissionmanager.roles'), // Table column heading |
52 | 52 | 'type' => 'select_multiple', |
53 | 53 | 'name' => 'roles', // the method that defines the relationship in your Model |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | 'label' => trans('backpack::permissionmanager.role'), |
67 | 67 | ], |
68 | 68 | config('permission.models.role')::all()->pluck(['name', 'id'])->toArray(), |
69 | - function ($value) { |
|
69 | + function($value) { |
|
70 | 70 | // if the filter is active |
71 | - $this->crud->addClause('whereHas', 'roles', function ($query) use ($value) { |
|
71 | + $this->crud->addClause('whereHas', 'roles', function($query) use ($value) { |
|
72 | 72 | $query->where('role_id', '=', $value); |
73 | 73 | }); |
74 | 74 | } |
@@ -119,12 +119,12 @@ discard block |
||
119 | 119 | protected function addFields() |
120 | 120 | { |
121 | 121 | $this->crud->addFields([ |
122 | - [ // Select2 |
|
122 | + [// Select2 |
|
123 | 123 | 'label' => trans('firstname'), |
124 | 124 | 'type' => 'text', |
125 | 125 | 'name' => 'firstname', |
126 | 126 | ], |
127 | - [ // Select2 |
|
127 | + [// Select2 |
|
128 | 128 | 'label' => trans('lastname'), |
129 | 129 | 'type' => 'text', |
130 | 130 | 'name' => 'lastname', |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function setup() |
28 | 28 | { |
29 | 29 | CRUD::setModel(\App\Models\Tax::class); |
30 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/tax'); |
|
30 | + CRUD::setRoute(config('backpack.base.route_prefix').'/tax'); |
|
31 | 31 | CRUD::setEntityNameStrings('tax', 'taxes'); |
32 | 32 | } |
33 | 33 |