@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | public function update(Contact $contact, Request $request) |
| 58 | 58 | { |
| 59 | 59 | // check if the user is allowed to edit the contact |
| 60 | - if (! backpack_user()->can('update', $contact)) { |
|
| 60 | + if (!backpack_user()->can('update', $contact)) { |
|
| 61 | 61 | abort(403); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | public function edit(Contact $contact) |
| 96 | 96 | { |
| 97 | 97 | // check if the user is allowed to edit the contact |
| 98 | - if (! backpack_user()->can('update', $contact)) { |
|
| 98 | + if (!backpack_user()->can('update', $contact)) { |
|
| 99 | 99 | abort(403); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | CRUD::addFields([ |
| 55 | 55 | ['name' => 'name', 'label' => 'Name', 'type' => 'text'], |
| 56 | 56 | ['name' => 'total', 'label' => 'Total', 'type' => 'text'], |
| 57 | - [ // Select |
|
| 57 | + [// Select |
|
| 58 | 58 | 'label' => 'Category', |
| 59 | 59 | 'type' => 'select', |
| 60 | 60 | 'name' => 'grade_type_category_id', // the db column for the foreign key |
@@ -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', |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | CRUD::setValidation(StoreRequest::class); |
| 65 | 65 | CRUD::addFields([ |
| 66 | - [ // Select2 |
|
| 66 | + [// Select2 |
|
| 67 | 67 | 'label' => 'User', |
| 68 | 68 | 'type' => 'select2', |
| 69 | 69 | 'name' => 'user_id', // the db column for the foreign key |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | protected function setupUpdateOperation() |
| 89 | 89 | { |
| 90 | 90 | CRUD::addFields([ |
| 91 | - [ // Select2 |
|
| 91 | + [// Select2 |
|
| 92 | 92 | 'label' => 'User', |
| 93 | 93 | 'type' => 'select2', |
| 94 | 94 | 'name' => 'user_id', // the db column for the foreign key |
@@ -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 | ]); |