We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -217,7 +217,7 @@ |
||
217 | 217 | |
218 | 218 | private function getButtonByName($name) |
219 | 219 | { |
220 | - return $this->crudPanel->buttons->first(function ($value) use ($name) { |
|
220 | + return $this->crudPanel->buttons->first(function($value) use ($name) { |
|
221 | 221 | return $value->name == $name; |
222 | 222 | }); |
223 | 223 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | protected function makeSlugUnique(string $slug, array $config, string $attribute): string |
51 | 51 | { |
52 | - if (! $config['unique']) { |
|
52 | + if (!$config['unique']) { |
|
53 | 53 | return $slug; |
54 | 54 | } |
55 | 55 |
@@ -33,12 +33,12 @@ |
||
33 | 33 | |
34 | 34 | public function __construct() |
35 | 35 | { |
36 | - if (! $this->crud) { |
|
36 | + if (!$this->crud) { |
|
37 | 37 | $this->crud = app()->make(CrudPanel::class); |
38 | 38 | |
39 | 39 | // call the setup function inside this closure to also have the request there |
40 | 40 | // this way, developers can use things stored in session (auth variables, etc) |
41 | - $this->middleware(function ($request, $next) { |
|
41 | + $this->middleware(function($request, $next) { |
|
42 | 42 | $this->request = $request; |
43 | 43 | $this->crud->request = $request; |
44 | 44 | $this->setup(); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $fakeFieldKey = isset($field['store_in']) ? $field['store_in'] : 'extras'; |
30 | 30 | $this->addCompactedField($requestInput, $field['name'], $fakeFieldKey); |
31 | 31 | |
32 | - if (! in_array($fakeFieldKey, $compactedFakeFields)) { |
|
32 | + if (!in_array($fakeFieldKey, $compactedFakeFields)) { |
|
33 | 33 | $compactedFakeFields[] = $fakeFieldKey; |
34 | 34 | } |
35 | 35 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // json_encode all fake_value columns if applicable in the database, so they can be properly stored and interpreted |
39 | 39 | foreach ($compactedFakeFields as $value) { |
40 | - if (! (property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true)) && $this->model->shouldEncodeFake($value)) { |
|
40 | + if (!(property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true)) && $this->model->shouldEncodeFake($value)) { |
|
41 | 41 | $requestInput[$value] = json_encode($requestInput[$value]); |
42 | 42 | } |
43 | 43 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function register() |
78 | 78 | { |
79 | - $this->app->bind('CRUD', function ($app) { |
|
79 | + $this->app->bind('CRUD', function($app) { |
|
80 | 80 | return new CRUD($app); |
81 | 81 | }); |
82 | 82 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $this->commands($this->commands); |
92 | 92 | |
93 | 93 | // map the elfinder prefix |
94 | - if (! \Config::get('elfinder.route.prefix')) { |
|
94 | + if (!\Config::get('elfinder.route.prefix')) { |
|
95 | 95 | \Config::set('elfinder.route.prefix', \Config::get('backpack.base.route_prefix').'/elfinder'); |
96 | 96 | } |
97 | 97 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $crudPubPath = public_path('vendor/backpack/crud'); |
113 | 113 | |
114 | - if (! is_dir($crudPubPath)) { |
|
114 | + if (!is_dir($crudPubPath)) { |
|
115 | 115 | return true; |
116 | 116 | } |
117 | 117 |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\PanelTraits; |
4 | 4 | |
5 | -use Illuminate\Database\Eloquent\Relations\HasOne; |
|
6 | 5 | use Illuminate\Database\Eloquent\Relations\BelongsTo; |
6 | +use Illuminate\Database\Eloquent\Relations\HasOne; |
|
7 | 7 | |
8 | 8 | trait Create |
9 | 9 | { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $all_relation_fields = $this->getRelationFields($form); |
92 | 92 | |
93 | - return array_where($all_relation_fields, function ($value, $key) { |
|
93 | + return array_where($all_relation_fields, function($value, $key) { |
|
94 | 94 | return isset($value['pivot']) && $value['pivot']; |
95 | 95 | }); |
96 | 96 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | private function createRelationsForItem($item, $formattedData) |
163 | 163 | { |
164 | - if (! isset($formattedData['relations'])) { |
|
164 | + if (!isset($formattedData['relations'])) { |
|
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | $key = implode('.relations.', explode('.', $relationField['entity'])); |
220 | 220 | $fieldData = array_get($relationData, 'relations.'.$key, []); |
221 | 221 | |
222 | - if (! array_key_exists('model', $fieldData)) { |
|
222 | + if (!array_key_exists('model', $fieldData)) { |
|
223 | 223 | $fieldData['model'] = $relationField['model']; |
224 | 224 | } |
225 | 225 | |
226 | - if (! array_key_exists('parent', $fieldData)) { |
|
226 | + if (!array_key_exists('parent', $fieldData)) { |
|
227 | 227 | $fieldData['parent'] = $this->getRelationModel($relationField['entity'], -1); |
228 | 228 | } |
229 | 229 |
@@ -159,7 +159,7 @@ |
||
159 | 159 | * @param \Illuminate\Database\Eloquent\Model $item The current CRUD model. |
160 | 160 | * @param array $formattedData The form data. |
161 | 161 | * |
162 | - * @return bool|null |
|
162 | + * @return false|null |
|
163 | 163 | */ |
164 | 164 | private function createRelationsForItem($item, $formattedData) |
165 | 165 | { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | foreach ($fields as &$field) { |
53 | 53 | // set the value |
54 | - if (! isset($field['value'])) { |
|
54 | + if (!isset($field['value'])) { |
|
55 | 55 | if (isset($field['subfields'])) { |
56 | 56 | $field['value'] = []; |
57 | 57 | foreach ($field['subfields'] as $subfield) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | // always have a hidden input for the entry id |
67 | - if (! array_key_exists('id', $fields)) { |
|
67 | + if (!array_key_exists('id', $fields)) { |
|
68 | 68 | $fields['id'] = [ |
69 | 69 | 'name' => $entry->getKeyName(), |
70 | 70 | 'value' => $entry->getKey(), |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | { |
88 | 88 | if (isset($field['entity'])) { |
89 | 89 | $relationArray = explode('.', $field['entity']); |
90 | - $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function ($obj, $method) { |
|
90 | + $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function($obj, $method) { |
|
91 | 91 | return $obj->{$method} ? $obj->{$method} : $obj; |
92 | 92 | }, $model); |
93 | 93 |
@@ -7,14 +7,14 @@ |
||
7 | 7 | |
8 | 8 | <div class="form-group backpack-filter m-b-0"> |
9 | 9 | <?php |
10 | - $from = ''; |
|
11 | - $to = ''; |
|
12 | - if($filter->currentValue) { |
|
13 | - $range = (array)json_decode($filter->currentValue); |
|
14 | - $from = $range['from']; |
|
15 | - $to = $range['to']; |
|
16 | - } |
|
17 | - ?> |
|
10 | + $from = ''; |
|
11 | + $to = ''; |
|
12 | + if($filter->currentValue) { |
|
13 | + $range = (array)json_decode($filter->currentValue); |
|
14 | + $from = $range['from']; |
|
15 | + $to = $range['to']; |
|
16 | + } |
|
17 | + ?> |
|
18 | 18 | <div class="input-group"> |
19 | 19 | <input class="form-control pull-right from" |
20 | 20 | type="number" |
@@ -9,8 +9,8 @@ |
||
9 | 9 | <?php |
10 | 10 | $from = ''; |
11 | 11 | $to = ''; |
12 | - if($filter->currentValue) { |
|
13 | - $range = (array)json_decode($filter->currentValue); |
|
12 | + if ($filter->currentValue) { |
|
13 | + $range = (array) json_decode($filter->currentValue); |
|
14 | 14 | $from = $range['from']; |
15 | 15 | $to = $range['to']; |
16 | 16 | } |
@@ -167,18 +167,18 @@ |
||
167 | 167 | { |
168 | 168 | foreach ($modifications as $key => $newValue) { |
169 | 169 | switch (strtolower($form)) { |
170 | - case 'create': |
|
170 | + case 'create': |
|
171 | 171 | $this->create_fields[$field][$key] = $newValue; |
172 | - break; |
|
172 | + break; |
|
173 | 173 | |
174 | - case 'update': |
|
174 | + case 'update': |
|
175 | 175 | $this->update_fields[$field][$key] = $newValue; |
176 | - break; |
|
176 | + break; |
|
177 | 177 | |
178 | - default: |
|
178 | + default: |
|
179 | 179 | $this->create_fields[$field][$key] = $newValue; |
180 | - $this->update_fields[$field][$key] = $newValue; |
|
181 | - break; |
|
180 | + $this->update_fields[$field][$key] = $newValue; |
|
181 | + break; |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | } |
@@ -28,28 +28,28 @@ discard block |
||
28 | 28 | |
29 | 29 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
30 | 30 | // defined in the main model |
31 | - if (isset($completeFieldsArray['entity']) && ! isset($completeFieldsArray['model'])) { |
|
31 | + if (isset($completeFieldsArray['entity']) && !isset($completeFieldsArray['model'])) { |
|
32 | 32 | $completeFieldsArray['model'] = $this->getRelationModel($completeFieldsArray['entity']); |
33 | 33 | } |
34 | 34 | |
35 | 35 | // if the label is missing, we should set it |
36 | - if (! isset($completeFieldsArray['label'])) { |
|
36 | + if (!isset($completeFieldsArray['label'])) { |
|
37 | 37 | $completeFieldsArray['label'] = mb_ucfirst(str_replace('_', ' ', $completeFieldsArray['name'])); |
38 | 38 | } |
39 | 39 | |
40 | 40 | // if the field type is missing, we should set it |
41 | - if (! isset($completeFieldsArray['type'])) { |
|
41 | + if (!isset($completeFieldsArray['type'])) { |
|
42 | 42 | $completeFieldsArray['type'] = $this->getFieldTypeFromDbColumnType($completeFieldsArray['name']); |
43 | 43 | } |
44 | 44 | |
45 | 45 | // if a tab was mentioned, we should enable it |
46 | 46 | if (isset($completeFieldsArray['tab'])) { |
47 | - if (! $this->tabsEnabled()) { |
|
47 | + if (!$this->tabsEnabled()) { |
|
48 | 48 | $this->enableTabs(); |
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - $this->transformFields($form, function ($fields) use ($completeFieldsArray) { |
|
52 | + $this->transformFields($form, function($fields) use ($completeFieldsArray) { |
|
53 | 53 | $fields[$completeFieldsArray['name']] = $completeFieldsArray; |
54 | 54 | |
55 | 55 | return $fields; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function afterField($targetFieldName, $form = 'both') |
83 | 83 | { |
84 | - $this->transformFields($form, function ($fields) use ($targetFieldName) { |
|
84 | + $this->transformFields($form, function($fields) use ($targetFieldName) { |
|
85 | 85 | return $this->moveField($fields, $targetFieldName, false); |
86 | 86 | }); |
87 | 87 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function beforeField($targetFieldName, $form = 'both') |
96 | 96 | { |
97 | - $this->transformFields($form, function ($fields) use ($targetFieldName) { |
|
97 | + $this->transformFields($form, function($fields) use ($targetFieldName) { |
|
98 | 98 | return $this->moveField($fields, $targetFieldName, true); |
99 | 99 | }); |
100 | 100 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function removeField($name, $form = 'both') |
139 | 139 | { |
140 | - $this->transformFields($form, function ($fields) use ($name) { |
|
140 | + $this->transformFields($form, function($fields) use ($name) { |
|
141 | 141 | array_forget($fields, $name); |
142 | 142 | |
143 | 143 | return $fields; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function removeFields($array_of_names, $form = 'both') |
154 | 154 | { |
155 | - if (! empty($array_of_names)) { |
|
155 | + if (!empty($array_of_names)) { |
|
156 | 156 | foreach ($array_of_names as $name) { |
157 | 157 | $this->removeField($name, $form); |
158 | 158 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function removeAllFields($form = 'both') |
168 | 168 | { |
169 | 169 | $current_fields = $this->getCurrentFields(); |
170 | - if (! empty($current_fields)) { |
|
170 | + if (!empty($current_fields)) { |
|
171 | 171 | foreach ($current_fields as $field) { |
172 | 172 | $this->removeField($field['name'], $form); |
173 | 173 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $jsonCastables = ['array', 'object', 'json']; |
258 | 258 | $fieldCasting = $casted_attributes[$field['name']]; |
259 | 259 | |
260 | - if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) { |
|
260 | + if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) { |
|
261 | 261 | try { |
262 | 262 | $data[$field['name']] = json_decode($data[$field['name']]); |
263 | 263 | } catch (\Exception $e) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function orderFields($order, $form = 'both') |
293 | 293 | { |
294 | - $this->transformFields($form, function ($fields) use ($order) { |
|
294 | + $this->transformFields($form, function($fields) use ($order) { |
|
295 | 295 | return $this->applyOrderToFields($fields, $order); |
296 | 296 | }); |
297 | 297 | } |