@@ -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 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | 'label' => trans('backpack::permissionmanager.email'), |
42 | 42 | 'type' => 'email', |
43 | 43 | ], |
44 | - [ // n-n relationship (with pivot table) |
|
44 | + [// n-n relationship (with pivot table) |
|
45 | 45 | 'label' => trans('backpack::permissionmanager.roles'), // Table column heading |
46 | 46 | 'type' => 'select_multiple', |
47 | 47 | 'name' => 'roles', // the method that defines the relationship in your Model |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | 'label' => trans('backpack::permissionmanager.role'), |
61 | 61 | ], |
62 | 62 | config('permission.models.role')::all()->pluck('name', 'id')->toArray(), |
63 | - function ($value) { // if the filter is active |
|
64 | - $this->crud->addClause('whereHas', 'roles', function ($query) use ($value) { |
|
63 | + function($value) { // if the filter is active |
|
64 | + $this->crud->addClause('whereHas', 'roles', function($query) use ($value) { |
|
65 | 65 | $query->where('role_id', '=', $value); |
66 | 66 | }); |
67 | 67 | } |
@@ -114,12 +114,12 @@ discard block |
||
114 | 114 | protected function addFields() |
115 | 115 | { |
116 | 116 | $this->crud->addFields([ |
117 | - [ // Select2 |
|
117 | + [// Select2 |
|
118 | 118 | 'label' => trans('firstname'), |
119 | 119 | 'type' => 'text', |
120 | 120 | 'name' => 'firstname', |
121 | 121 | ], |
122 | - [ // Select2 |
|
122 | + [// Select2 |
|
123 | 123 | 'label' => trans('lastname'), |
124 | 124 | 'type' => 'text', |
125 | 125 | 'name' => 'lastname', |
@@ -29,10 +29,10 @@ |
||
29 | 29 | $this->crud->replaceSaveActions( |
30 | 30 | [ |
31 | 31 | 'name' => __('Save and go back'), |
32 | - 'visible' => function ($crud) { |
|
32 | + 'visible' => function($crud) { |
|
33 | 33 | return true; |
34 | 34 | }, |
35 | - 'redirect' => function ($crud, $request, $itemId) { |
|
35 | + 'redirect' => function($crud, $request, $itemId) { |
|
36 | 36 | $enrollment_id = Payment::find($itemId)->enrollment_id; |
37 | 37 | |
38 | 38 | return route('enrollment.show', ['id' => $enrollment_id]); |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | 'type' => 'select', |
47 | 47 | 'entity' => 'student', // the method that defines the relationship in your Model |
48 | 48 | 'attribute' => 'name', // foreign key attribute that is shown to user |
49 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
50 | - $query->orWhereHas('student', function ($q) use ($searchTerm) { |
|
51 | - $q->WhereHas('user', function ($q) use ($searchTerm) { |
|
49 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
50 | + $query->orWhereHas('student', function($q) use ($searchTerm) { |
|
51 | + $q->WhereHas('user', function($q) use ($searchTerm) { |
|
52 | 52 | $q->where('firstname', 'like', '%'.$searchTerm.'%') |
53 | 53 | ->orWhere('lastname', 'like', '%'.$searchTerm.'%') |
54 | 54 | ->orWhere('email', 'like', '%'.$searchTerm.'%') |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'label'=> __('No Result'), |
88 | 88 | ], |
89 | 89 | false, |
90 | - function () { |
|
90 | + function() { |
|
91 | 91 | CRUD::addClause('noResult'); |
92 | 92 | }); |
93 | 93 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'label'=> __('Hide Parents'), |
98 | 98 | ], |
99 | 99 | false, |
100 | - function () { |
|
100 | + function() { |
|
101 | 101 | CRUD::addClause('real'); |
102 | 102 | }); |
103 | 103 | |
@@ -105,20 +105,20 @@ discard block |
||
105 | 105 | 'name' => 'period_id', |
106 | 106 | 'type' => 'select2', |
107 | 107 | 'label'=> __('Period'), |
108 | - ], function () { |
|
108 | + ], function() { |
|
109 | 109 | return Period::all()->pluck('name', 'id')->toArray(); |
110 | - }, function ($value) { // if the filter is active |
|
110 | + }, function($value) { // if the filter is active |
|
111 | 111 | CRUD::addClause('period', $value); |
112 | 112 | }); |
113 | 113 | |
114 | - CRUD::addFilter([ // select2_multiple filter |
|
114 | + CRUD::addFilter([// select2_multiple filter |
|
115 | 115 | 'name' => 'result', |
116 | 116 | 'type' => 'select2', |
117 | 117 | 'label'=> __('Result'), |
118 | - ], function () { // the options that show up in the select2 |
|
118 | + ], function() { // the options that show up in the select2 |
|
119 | 119 | return ResultType::all()->pluck('name', 'id')->toArray(); |
120 | - }, function ($value) { // if the filter is active |
|
121 | - $this->crud->query = $this->crud->query->whereHas('result', function ($query) use ($value) { |
|
120 | + }, function($value) { // if the filter is active |
|
121 | + $this->crud->query = $this->crud->query->whereHas('result', function($query) use ($value) { |
|
122 | 122 | $query->where('result_type_id', $value); |
123 | 123 | }); |
124 | 124 | }); |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | 'name' => 'user.lastname', |
70 | 70 | 'label' => __('Last Name'), |
71 | 71 | 'type' => 'text', |
72 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
73 | - $query->orWhereHas('student', function ($q) use ($searchTerm) { |
|
74 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
72 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
73 | + $query->orWhereHas('student', function($q) use ($searchTerm) { |
|
74 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
75 | 75 | $q->where('lastname', 'like', '%'.$searchTerm.'%'); |
76 | 76 | }); |
77 | 77 | }); |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | 'name' => 'user.firstname', |
83 | 83 | 'label' => __('First Name'), |
84 | 84 | 'type' => 'text', |
85 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
86 | - $query->orWhereHas('student', function ($q) use ($searchTerm) { |
|
87 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
85 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
86 | + $query->orWhereHas('student', function($q) use ($searchTerm) { |
|
87 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
88 | 88 | $q->where('firstname', 'like', '%'.$searchTerm.'%'); |
89 | 89 | }); |
90 | 90 | }); |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | 'name' => 'status_id', |
134 | 134 | 'type' => 'select2_multiple', |
135 | 135 | 'label'=> __('Status'), |
136 | - ], function () { |
|
136 | + ], function() { |
|
137 | 137 | return EnrollmentStatusType::all()->pluck('name', 'id')->toArray(); |
138 | 138 | }, |
139 | - function ($values) { // if the filter is active |
|
139 | + function($values) { // if the filter is active |
|
140 | 140 | foreach (json_decode($values) as $key => $value) { |
141 | 141 | CRUD::addClause('orWhere', 'status_id', $value); |
142 | 142 | } |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | 'name' => 'period_id', |
147 | 147 | 'type' => 'select2', |
148 | 148 | 'label'=> __('Period'), |
149 | - ], function () { |
|
149 | + ], function() { |
|
150 | 150 | return Period::all()->pluck('name', 'id')->toArray(); |
151 | - }, function ($value) { // if the filter is active |
|
151 | + }, function($value) { // if the filter is active |
|
152 | 152 | CRUD::addClause('period', $value); |
153 | 153 | }); |
154 | 154 | } |
@@ -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,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | protected function gate() |
63 | 63 | { |
64 | - Gate::define('viewTelescope', function ($user) { |
|
64 | + Gate::define('viewTelescope', function($user) { |
|
65 | 65 | return in_array($user->email, [ |
66 | 66 | // |
67 | 67 | ]); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | View::composer( |
40 | - ['partials.create_new_contact', 'students.edit-contact'], function ($view) { |
|
40 | + ['partials.create_new_contact', 'students.edit-contact'], function($view) { |
|
41 | 41 | $view->with('contact_types', ContactRelationship::all()); |
42 | 42 | }); |
43 | 43 | } |
@@ -87,17 +87,17 @@ discard block |
||
87 | 87 | ], |
88 | 88 | ]); |
89 | 89 | |
90 | - CRUD::addFilter([ // simple filter |
|
90 | + CRUD::addFilter([// simple filter |
|
91 | 91 | 'type' => 'simple', |
92 | 92 | 'name' => 'action', |
93 | 93 | 'label'=> 'Action', |
94 | 94 | ], |
95 | 95 | false, |
96 | - function () { // if the filter is active |
|
96 | + function() { // if the filter is active |
|
97 | 97 | CRUD::addClause('where', 'action', true); |
98 | 98 | }); |
99 | 99 | |
100 | - CRUD::addFilter([ // dropdown filter |
|
100 | + CRUD::addFilter([// dropdown filter |
|
101 | 101 | 'name' => 'type', |
102 | 102 | 'type' => 'dropdown', |
103 | 103 | 'label'=> 'Type', |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | Enrollment::class => 'Enrollments', |
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 | }); |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | |
58 | 58 | $permissions = backpack_user()->getAllPermissions(); |
59 | 59 | |
60 | - if (! $permissions->contains('name', 'courses.edit')) { |
|
60 | + if (!$permissions->contains('name', 'courses.edit')) { |
|
61 | 61 | CRUD::denyAccess('update'); |
62 | 62 | } |
63 | 63 | |
64 | - if (! $permissions->contains('name', 'courses.edit')) { |
|
64 | + if (!$permissions->contains('name', 'courses.edit')) { |
|
65 | 65 | CRUD::denyAccess('create'); |
66 | 66 | } |
67 | 67 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | CRUD::addButtonFromView('line', 'children_badge', 'children_badge', 'beginning'); |
77 | 77 | |
78 | - if (! $permissions->contains('name', 'courses.delete')) { |
|
78 | + if (!$permissions->contains('name', 'courses.delete')) { |
|
79 | 79 | CRUD::denyAccess('delete'); |
80 | 80 | } |
81 | 81 | |
@@ -172,52 +172,52 @@ discard block |
||
172 | 172 | |
173 | 173 | ]); |
174 | 174 | |
175 | - CRUD::addFilter([ // select2 filter |
|
175 | + CRUD::addFilter([// select2 filter |
|
176 | 176 | 'name' => 'rhythm_id', |
177 | 177 | 'type' => 'select2', |
178 | 178 | 'label'=> __('Rhythm'), |
179 | - ], function () { |
|
179 | + ], function() { |
|
180 | 180 | return Rhythm::all()->pluck('name', 'id')->toArray(); |
181 | - }, function ($value) { // if the filter is active |
|
181 | + }, function($value) { // if the filter is active |
|
182 | 182 | CRUD::addClause('where', 'rhythm_id', $value); |
183 | 183 | }, |
184 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
184 | + function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
185 | 185 | }); |
186 | 186 | |
187 | - CRUD::addFilter([ // select2 filter |
|
187 | + CRUD::addFilter([// select2 filter |
|
188 | 188 | 'name' => 'teacher_id', |
189 | 189 | 'type' => 'select2', |
190 | 190 | 'label'=> __('Teacher'), |
191 | - ], function () { |
|
191 | + ], function() { |
|
192 | 192 | return Teacher::all()->pluck('name', 'id')->toArray(); |
193 | - }, function ($value) { // if the filter is active |
|
193 | + }, function($value) { // if the filter is active |
|
194 | 194 | CRUD::addClause('where', 'teacher_id', $value); |
195 | 195 | }, |
196 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
196 | + function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
197 | 197 | }); |
198 | 198 | |
199 | - CRUD::addFilter([ // select2 filter |
|
199 | + CRUD::addFilter([// select2 filter |
|
200 | 200 | 'name' => 'level_id', |
201 | 201 | 'type' => 'select2', |
202 | 202 | 'label'=> __('Level'), |
203 | - ], function () { |
|
203 | + ], function() { |
|
204 | 204 | return Level::all()->pluck('name', 'id')->toArray(); |
205 | - }, function ($value) { // if the filter is active |
|
205 | + }, function($value) { // if the filter is active |
|
206 | 206 | CRUD::addClause('where', 'level_id', $value); |
207 | 207 | }, |
208 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
208 | + function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
209 | 209 | }); |
210 | 210 | |
211 | - CRUD::addFilter([ // select2 filter |
|
211 | + CRUD::addFilter([// select2 filter |
|
212 | 212 | 'name' => 'period_id', |
213 | 213 | 'type' => 'select2', |
214 | 214 | 'label'=> __('Period'), |
215 | - ], function () { |
|
215 | + ], function() { |
|
216 | 216 | return Period::all()->sortByDesc('id')->pluck('name', 'id')->toArray(); |
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 |