We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function addFakes($columns = ['extras']) |
21 | 21 | { |
22 | 22 | foreach ($columns as $key => $column) { |
23 | - if (! isset($this->attributes[$column])) { |
|
23 | + if (!isset($this->attributes[$column])) { |
|
24 | 24 | continue; |
25 | 25 | } |
26 | 26 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function shouldDecodeFake($column) |
69 | 69 | { |
70 | - return ! in_array($column, array_keys($this->getCasts())); |
|
70 | + return !in_array($column, array_keys($this->getCasts())); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -78,6 +78,6 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function shouldEncodeFake($column) |
80 | 80 | { |
81 | - return ! in_array($column, array_keys($this->getCasts())); |
|
81 | + return !in_array($column, array_keys($this->getCasts())); |
|
82 | 82 | } |
83 | 83 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'operation' => 'list', |
29 | 29 | ]); |
30 | 30 | |
31 | - if (! isset($this->setupDetailsRowRoute) || $this->setupDetailsRowRoute === true) { |
|
31 | + if (!isset($this->setupDetailsRowRoute) || $this->setupDetailsRowRoute === true) { |
|
32 | 32 | Route::get($segment.'/{id}/details', [ |
33 | 33 | 'as' => $routeName.'.showDetailsRow', |
34 | 34 | 'uses' => $controller.'@showDetailsRow', |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $this->crud->allowAccess('list'); |
46 | 46 | |
47 | - LifecycleHook::hookInto('list:before_setup', function () { |
|
47 | + LifecycleHook::hookInto('list:before_setup', function() { |
|
48 | 48 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
49 | 49 | $this->crud->setOperationSetting('datatablesUrl', $this->crud->getRoute()); |
50 | 50 | }); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $search = request()->input('search'); |
83 | 83 | |
84 | 84 | // check if length is allowed by developer |
85 | - if ($length && ! in_array($length, $this->crud->getPageLengthMenu()[0])) { |
|
85 | + if ($length && !in_array($length, $this->crud->getPageLengthMenu()[0])) { |
|
86 | 86 | return response()->json([ |
87 | 87 | 'error' => 'Unknown page length.', |
88 | 88 | ], 400); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('translatable', function (Blueprint $table) { |
|
16 | + Schema::create('translatable', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->json('title'); |
19 | 19 | $table->json('description')->nullable(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | //remove fields that are not in the submitted form input |
101 | - $relationFields = array_filter($relationFields, function ($field) use ($input) { |
|
101 | + $relationFields = array_filter($relationFields, function($field) use ($input) { |
|
102 | 102 | return Arr::has($input, $field['name']) || isset($input[$field['name']]) || Arr::has($input, Str::afterLast($field['name'], '.')); |
103 | 103 | }); |
104 | 104 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | // the key used to store the values is the main relation key |
128 | 128 | $key = Str::beforeLast($this->getOnlyRelationEntity($field), '.'); |
129 | 129 | |
130 | - if (! isset($field['parentFieldName']) && isset($field['entity'])) { |
|
130 | + if (!isset($field['parentFieldName']) && isset($field['entity'])) { |
|
131 | 131 | $mainField = $field; |
132 | 132 | $mainField['entity'] = Str::beforeLast($field['entity'], '.'); |
133 | 133 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | // when using dot notation if relationMethod is not set we are sure we want to exclude those relations. |
187 | 187 | if ($this->getOnlyRelationEntity($field) !== $field['entity']) { |
188 | - if (! $relationMethod) { |
|
188 | + if (!$relationMethod) { |
|
189 | 189 | $excludedFields[] = $nameToExclude; |
190 | 190 | } |
191 | 191 | |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | } |
200 | 200 | } |
201 | 201 | |
202 | - return Arr::where($input, function ($item, $key) use ($excludedFields) { |
|
203 | - return ! in_array($key, $excludedFields); |
|
202 | + return Arr::where($input, function($item, $key) use ($excludedFields) { |
|
203 | + return !in_array($key, $excludedFields); |
|
204 | 204 | }); |
205 | 205 | } |
206 | 206 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $jsonCastables = ['array', 'object', 'json']; |
228 | 228 | $fieldCasting = $casted_attributes[$field['name']]; |
229 | 229 | |
230 | - if (in_array($fieldCasting, $jsonCastables) && isset($input[$field['name']]) && ! empty($input[$field['name']]) && ! is_array($input[$field['name']]) && ! in_array($field['name'], $translatableAttributes)) { |
|
230 | + if (in_array($fieldCasting, $jsonCastables) && isset($input[$field['name']]) && !empty($input[$field['name']]) && !is_array($input[$field['name']]) && !in_array($field['name'], $translatableAttributes)) { |
|
231 | 231 | try { |
232 | 232 | $input[$field['name']] = json_decode($input[$field['name']]); |
233 | 233 | } catch (\Exception $e) { |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | { |
17 | 17 | $this->getDbColumnTypes(); |
18 | 18 | |
19 | - array_map(function ($field) use ($setFields, $setColumns) { |
|
20 | - if ($setFields && ! isset($this->getCleanStateFields()[$field])) { |
|
19 | + array_map(function($field) use ($setFields, $setColumns) { |
|
20 | + if ($setFields && !isset($this->getCleanStateFields()[$field])) { |
|
21 | 21 | $this->addField([ |
22 | 22 | 'name' => $field, |
23 | 23 | 'label' => $this->makeLabel($field), |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | ]); |
31 | 31 | } |
32 | 32 | |
33 | - if ($setColumns && ! in_array($field, $this->getModel()->getHidden()) && ! isset($this->columns()[$field])) { |
|
33 | + if ($setColumns && !in_array($field, $this->getModel()->getHidden()) && !isset($this->columns()[$field])) { |
|
34 | 34 | $this->addColumn([ |
35 | 35 | 'name' => $field, |
36 | 36 | 'label' => $this->makeLabel($field), |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | { |
53 | 53 | $dbColumnTypes = []; |
54 | 54 | |
55 | - if (! $this->driverIsSql()) { |
|
55 | + if (!$this->driverIsSql()) { |
|
56 | 56 | return $dbColumnTypes; |
57 | 57 | } |
58 | 58 | $dbColumns = $this->getDbTableColumns(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | $dbColumnTypes = $this->getDbColumnTypes(); |
119 | 119 | |
120 | - if (! isset($dbColumnTypes[$fieldName])) { |
|
120 | + if (!isset($dbColumnTypes[$fieldName])) { |
|
121 | 121 | return 'text'; |
122 | 122 | } |
123 | 123 | |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | { |
213 | 213 | $fillable = $this->model->getFillable(); |
214 | 214 | |
215 | - if (! $this->driverIsSql()) { |
|
215 | + if (!$this->driverIsSql()) { |
|
216 | 216 | $columns = $fillable; |
217 | 217 | } else { |
218 | 218 | // Automatically-set columns should be both in the database, and in the $fillable variable on the Eloquent Model |
219 | 219 | $columns = $this->model::getDbTableSchema()->getColumnsNames(); |
220 | - if (! empty($fillable)) { |
|
220 | + if (!empty($fillable)) { |
|
221 | 221 | $columns = array_intersect($columns, $fillable); |
222 | 222 | } |
223 | 223 | } |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | |
30 | 30 | public bool $implicit = true; |
31 | 31 | |
32 | - public static function field(string|array|ValidationRule|Rule $rules = []): self |
|
32 | + public static function field(string | array | ValidationRule | Rule $rules = []): self |
|
33 | 33 | { |
34 | 34 | $instance = new static(); |
35 | 35 | $instance->fieldRules = self::getRulesAsArray($rules); |
36 | 36 | |
37 | 37 | if ($instance->validatesArrays()) { |
38 | - if (! in_array('array', $instance->getFieldRules())) { |
|
38 | + if (!in_array('array', $instance->getFieldRules())) { |
|
39 | 39 | $instance->fieldRules[] = 'array'; |
40 | 40 | } |
41 | 41 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | public function getFieldRules(): array |
97 | 97 | { |
98 | - return tap($this->fieldRules, function ($rule) { |
|
98 | + return tap($this->fieldRules, function($rule) { |
|
99 | 99 | if (is_a($rule, BackpackCustomRule::class, true)) { |
100 | 100 | $rule = $rule->getFieldRules(); |
101 | 101 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $rules = explode('|', $rules); |
111 | 111 | } |
112 | 112 | |
113 | - if (! is_array($rules)) { |
|
113 | + if (!is_array($rules)) { |
|
114 | 114 | $rules = [$rules]; |
115 | 115 | } |
116 | 116 | |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | |
120 | 120 | protected function ensureValueIsValid($value) |
121 | 121 | { |
122 | - if ($this->validatesArrays() && ! is_array($value)) { |
|
122 | + if ($this->validatesArrays() && !is_array($value)) { |
|
123 | 123 | try { |
124 | 124 | $value = json_decode($value, true) ?? []; |
125 | - } catch(\Exception $e) { |
|
125 | + } catch (\Exception $e) { |
|
126 | 126 | return false; |
127 | 127 | } |
128 | 128 | } |
@@ -141,12 +141,12 @@ discard block |
||
141 | 141 | $attribute => $rules, |
142 | 142 | ], $this->validator->customMessages, $this->getValidatorCustomAttributes($attribute)); |
143 | 143 | |
144 | - return $validator->errors()->messages()[$attribute] ?? (! empty($validator->errors()->messages()) ? current($validator->errors()->messages()) : []); |
|
144 | + return $validator->errors()->messages()[$attribute] ?? (!empty($validator->errors()->messages()) ? current($validator->errors()->messages()) : []); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | private function getValidatorCustomAttributes(string $attribute): array |
148 | 148 | { |
149 | - if (! is_a($this, ValidGenericAjaxEndpoint::class) && ! Str::contains($attribute, '.*.')) { |
|
149 | + if (!is_a($this, ValidGenericAjaxEndpoint::class) && !Str::contains($attribute, '.*.')) { |
|
150 | 150 | return $this->validator->customAttributes; |
151 | 151 | } |
152 | 152 | |
@@ -157,8 +157,7 @@ discard block |
||
157 | 157 | protected function getValidationAttributeString(string $attribute) |
158 | 158 | { |
159 | 159 | return Str::substrCount($attribute, '.') > 1 ? |
160 | - Str::before($attribute, '.').'.*.'.Str::afterLast($attribute, '.') : |
|
161 | - $attribute; |
|
160 | + Str::before($attribute, '.').'.*.'.Str::afterLast($attribute, '.') : $attribute; |
|
162 | 161 | } |
163 | 162 | |
164 | 163 | protected function validateOnSubmit(string $attribute, mixed $value): array |
@@ -178,7 +177,7 @@ discard block |
||
178 | 177 | /** |
179 | 178 | * Implementation. |
180 | 179 | */ |
181 | - public function validateFieldRules(string $attribute, null|array|string|UploadedFile $data = null, ?array $customRules = null): array |
|
180 | + public function validateFieldRules(string $attribute, null | array | string | UploadedFile $data = null, ?array $customRules = null): array |
|
182 | 181 | { |
183 | 182 | $data = $data ?? $this->data; |
184 | 183 | $validationRuleAttribute = $this->getValidationAttributeString($attribute); |
@@ -187,16 +186,16 @@ discard block |
||
187 | 186 | return $this->validateAndGetErrors($validationRuleAttribute, $data, $customRules ?? $this->getFieldRules()); |
188 | 187 | } |
189 | 188 | |
190 | - protected function prepareValidatorData(array|string|UploadedFile $data, string $attribute): array |
|
189 | + protected function prepareValidatorData(array | string | UploadedFile $data, string $attribute): array |
|
191 | 190 | { |
192 | - if ($this->validatesArrays() && is_array($data) && ! Str::contains($attribute, '.')) { |
|
191 | + if ($this->validatesArrays() && is_array($data) && !Str::contains($attribute, '.')) { |
|
193 | 192 | return Arr::has($data, $attribute) ? $data : [$attribute => $data]; |
194 | 193 | } |
195 | 194 | |
196 | 195 | if (Str::contains($attribute, '.')) { |
197 | 196 | $validData = []; |
198 | 197 | |
199 | - Arr::set($validData, $attribute, ! is_array($data) ? $data : Arr::get($data, $attribute)); |
|
198 | + Arr::set($validData, $attribute, !is_array($data) ? $data : Arr::get($data, $attribute)); |
|
200 | 199 | |
201 | 200 | return $validData; |
202 | 201 | } |
@@ -211,7 +210,7 @@ discard block |
||
211 | 210 | $validationRuleAttribute = $this->getValidationAttributeString($attribute); |
212 | 211 | |
213 | 212 | $filesToValidate = Arr::get($items, $attribute); |
214 | - $filesToValidate = is_array($filesToValidate) ? array_filter($filesToValidate, function ($item) { |
|
213 | + $filesToValidate = is_array($filesToValidate) ? array_filter($filesToValidate, function($item) { |
|
215 | 214 | return $item instanceof UploadedFile; |
216 | 215 | }) : (is_a($filesToValidate, UploadedFile::class, true) ? [$filesToValidate] : []); |
217 | 216 |
@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | private string $crudObjectType; |
15 | 15 | |
16 | 16 | public function __construct( |
17 | - private readonly CrudField|CrudColumn $crudObject, |
|
17 | + private readonly CrudField | CrudColumn $crudObject, |
|
18 | 18 | private readonly array $uploaderConfiguration, |
19 | 19 | private readonly string $macro |
20 | 20 | ) { |
21 | 21 | $this->crudObjectType = is_a($crudObject, CrudField::class) ? 'field' : (is_a($crudObject, CrudColumn::class) ? 'column' : null); |
22 | 22 | |
23 | - if (! $this->crudObjectType) { |
|
23 | + if (!$this->crudObjectType) { |
|
24 | 24 | abort(500, 'Upload handlers only work for CrudField and CrudColumn classes.', ['developer-error-exception']); |
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | - public static function handle(CrudField|CrudColumn $crudObject, array $uploaderConfiguration, string $macro, ?array $subfield = null, ?bool $registerModelEvents = true): void |
|
28 | + public static function handle(CrudField | CrudColumn $crudObject, array $uploaderConfiguration, string $macro, ?array $subfield = null, ?bool $registerModelEvents = true): void |
|
29 | 29 | { |
30 | 30 | $instance = new self($crudObject, $uploaderConfiguration, $macro); |
31 | 31 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | *******************************/ |
38 | 38 | private function registerEvents(?array $subfield = [], ?bool $registerModelEvents = true): void |
39 | 39 | { |
40 | - if (! empty($subfield)) { |
|
40 | + if (!empty($subfield)) { |
|
41 | 41 | $this->registerSubfieldEvent($subfield, $registerModelEvents); |
42 | 42 | |
43 | 43 | return; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $subfields = collect($this->crudObject->getAttributes()['subfields']); |
85 | - $subfields = $subfields->map(function ($item) use ($subfield, $uploader) { |
|
85 | + $subfields = $subfields->map(function($item) use ($subfield, $uploader) { |
|
86 | 86 | if ($item['name'] === $subfield['name']) { |
87 | 87 | $item['upload'] = true; |
88 | 88 | $item['disk'] = $uploader->getDisk(); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | if ($this->crudObjectType === 'field') { |
115 | - $model::saving(function ($entry) use ($uploader) { |
|
115 | + $model::saving(function($entry) use ($uploader) { |
|
116 | 116 | $entry = $uploader->storeUploadedFiles($entry); |
117 | 117 | }); |
118 | 118 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | // is not called in pivot models when loading the relations. |
126 | 126 | $retrieveModel = $this->getModelForRetrieveEvent($model, $uploader); |
127 | 127 | |
128 | - $retrieveModel::retrieved(function ($entry) use ($uploader) { |
|
128 | + $retrieveModel::retrieved(function($entry) use ($uploader) { |
|
129 | 129 | if ($entry->translationEnabled()) { |
130 | 130 | $locale = request('_locale', app()->getLocale()); |
131 | 131 | if (in_array($locale, array_keys($entry->getAvailableLocales()))) { |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | }); |
137 | 137 | } |
138 | 138 | |
139 | - $model::deleting(function ($entry) use ($uploader) { |
|
139 | + $model::deleting(function($entry) use ($uploader) { |
|
140 | 140 | $uploader->deleteUploadedFiles($entry); |
141 | 141 | }); |
142 | 142 | |
143 | 143 | // if the uploader is a relationship and handles repeatable files, we will also register the deleting event on the |
144 | 144 | // parent model. that way we can control the deletion of the files when the parent model is deleted. |
145 | 145 | if ($uploader->isRelationship() && $uploader->handleRepeatableFiles) { |
146 | - app('crud')->model::deleting(function ($entry) use ($uploader) { |
|
146 | + app('crud')->model::deleting(function($entry) use ($uploader) { |
|
147 | 147 | $uploader->deleteUploadedFiles($entry); |
148 | 148 | }); |
149 | 149 | } |
@@ -165,18 +165,18 @@ discard block |
||
165 | 165 | { |
166 | 166 | $hasCustomUploader = isset($uploaderConfiguration['uploader']); |
167 | 167 | |
168 | - if ($hasCustomUploader && ! is_a($uploaderConfiguration['uploader'], UploaderInterface::class, true)) { |
|
168 | + if ($hasCustomUploader && !is_a($uploaderConfiguration['uploader'], UploaderInterface::class, true)) { |
|
169 | 169 | throw new Exception('Invalid uploader class provided for '.$this->crudObjectType.' type: '.$crudObject['type']); |
170 | 170 | } |
171 | 171 | |
172 | 172 | if ($hasCustomUploader) { |
173 | - return $uploaderConfiguration['uploader']::for($crudObject, $uploaderConfiguration); |
|
173 | + return $uploaderConfiguration['uploader']::for ($crudObject, $uploaderConfiguration); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | $uploader = app('UploadersRepository')->hasUploadFor($crudObject['type'], $this->macro); |
177 | 177 | |
178 | 178 | if ($uploader) { |
179 | - return app('UploadersRepository')->getUploadFor($crudObject['type'], $this->macro)::for($crudObject, $uploaderConfiguration); |
|
179 | + return app('UploadersRepository')->getUploadFor($crudObject['type'], $this->macro)::for ($crudObject, $uploaderConfiguration); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | throw new Exception('Undefined upload type for '.$this->crudObjectType.' type: '.$crudObject['type']); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | private function getSubfieldModel(array $subfield, UploaderInterface $uploader) |
199 | 199 | { |
200 | - if (! $uploader->isRelationship()) { |
|
200 | + if (!$uploader->isRelationship()) { |
|
201 | 201 | return $subfield['baseModel'] ?? get_class(app('crud')->getModel()); |
202 | 202 | } |
203 | 203 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | private function getModelForRetrieveEvent(string $model, UploaderInterface $uploader) |
212 | 212 | { |
213 | - if (! $uploader->isRelationship()) { |
|
213 | + if (!$uploader->isRelationship()) { |
|
214 | 214 | return $model; |
215 | 215 | } |
216 | 216 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public array $hooks = []; |
10 | 10 | |
11 | - public function hookInto(string|array $hooks, callable $callback): void |
|
11 | + public function hookInto(string | array $hooks, callable $callback): void |
|
12 | 12 | { |
13 | 13 | $hooks = is_array($hooks) ? $hooks : [$hooks]; |
14 | 14 | $controller = CrudManager::getActiveController() ?? CrudManager::getRequestController(); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | - public function trigger(string|array $hooks, array $parameters = []): void |
|
20 | + public function trigger(string | array $hooks, array $parameters = []): void |
|
21 | 21 | { |
22 | 22 | $hooks = is_array($hooks) ? $hooks : [$hooks]; |
23 | 23 | $controller = CrudManager::getActiveController() ?? CrudManager::getRequestController(); |
@@ -83,32 +83,32 @@ discard block |
||
83 | 83 | |
84 | 84 | $this->registerBackpackErrorViews(); |
85 | 85 | |
86 | - $this->app->bind('crud', function ($app) { |
|
86 | + $this->app->bind('crud', function($app) { |
|
87 | 87 | return CrudManager::getCrudPanel(); |
88 | 88 | }); |
89 | 89 | |
90 | - $this->app->scoped('CrudManager', function ($app) { |
|
90 | + $this->app->scoped('CrudManager', function($app) { |
|
91 | 91 | return new CrudPanelManager(); |
92 | 92 | }); |
93 | 93 | |
94 | - $this->app->scoped('DatabaseSchema', function ($app) { |
|
94 | + $this->app->scoped('DatabaseSchema', function($app) { |
|
95 | 95 | return new DatabaseSchema(); |
96 | 96 | }); |
97 | 97 | |
98 | - $this->app->scoped('BackpackLifecycleHooks', function ($app) { |
|
98 | + $this->app->scoped('BackpackLifecycleHooks', function($app) { |
|
99 | 99 | return new app\Library\CrudPanel\Hooks\LifecycleHooks(); |
100 | 100 | }); |
101 | 101 | |
102 | - $this->app->singleton('BackpackViewNamespaces', function ($app) { |
|
102 | + $this->app->singleton('BackpackViewNamespaces', function($app) { |
|
103 | 103 | return new ViewNamespaces(); |
104 | 104 | }); |
105 | 105 | |
106 | 106 | // Bind the widgets collection object to Laravel's service container |
107 | - $this->app->singleton('widgets', function ($app) { |
|
107 | + $this->app->singleton('widgets', function($app) { |
|
108 | 108 | return new Collection(); |
109 | 109 | }); |
110 | 110 | |
111 | - $this->app->scoped('UploadersRepository', function ($app) { |
|
111 | + $this->app->scoped('UploadersRepository', function($app) { |
|
112 | 112 | return new UploadersRepository(); |
113 | 113 | }); |
114 | 114 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $middleware_key = config('backpack.base.middleware_key'); |
125 | 125 | $middleware_class = config('backpack.base.middleware_class'); |
126 | 126 | |
127 | - if (! is_array($middleware_class)) { |
|
127 | + if (!is_array($middleware_class)) { |
|
128 | 128 | $router->pushMiddlewareToGroup($middleware_key, $middleware_class); |
129 | 129 | |
130 | 130 | return; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $configs = scandir(__DIR__."/config/backpack/$dir/"); |
240 | 240 | $configs = array_diff($configs, ['.', '..']); |
241 | 241 | |
242 | - if (! count($configs)) { |
|
242 | + if (!count($configs)) { |
|
243 | 243 | return; |
244 | 244 | } |
245 | 245 | |
@@ -288,8 +288,7 @@ discard block |
||
288 | 288 | // add the backpack_users password broker to the configuration |
289 | 289 | $laravelAuthPasswordBrokers = app()->config['auth.passwords']; |
290 | 290 | $laravelFirstPasswordBroker = is_array($laravelAuthPasswordBrokers) && current($laravelAuthPasswordBrokers) ? |
291 | - current($laravelAuthPasswordBrokers)['table'] : |
|
292 | - ''; |
|
291 | + current($laravelAuthPasswordBrokers)['table'] : ''; |
|
293 | 292 | |
294 | 293 | $backpackPasswordBrokerTable = config('backpack.base.password_resets_table') ?? |
295 | 294 | config('auth.passwords.users.table') ?? |
@@ -317,7 +316,7 @@ discard block |
||
317 | 316 | |
318 | 317 | public function loadViewComponents() |
319 | 318 | { |
320 | - $this->app->afterResolving(BladeCompiler::class, function () { |
|
319 | + $this->app->afterResolving(BladeCompiler::class, function() { |
|
321 | 320 | Blade::componentNamespace('Backpack\\CRUD\\app\\View\\Components', 'backpack'); |
322 | 321 | }); |
323 | 322 | } |
@@ -343,13 +342,13 @@ discard block |
||
343 | 342 | private function registerBackpackErrorViews() |
344 | 343 | { |
345 | 344 | // register the backpack error when the exception handler is resolved from the container |
346 | - $this->callAfterResolving(ExceptionHandler::class, function ($handler) { |
|
347 | - if (! Str::startsWith(request()->path(), config('backpack.base.route_prefix'))) { |
|
345 | + $this->callAfterResolving(ExceptionHandler::class, function($handler) { |
|
346 | + if (!Str::startsWith(request()->path(), config('backpack.base.route_prefix'))) { |
|
348 | 347 | return; |
349 | 348 | } |
350 | 349 | |
351 | 350 | // parse the namespaces set in config |
352 | - [$themeNamespace, $themeFallbackNamespace] = (function () { |
|
351 | + [$themeNamespace, $themeFallbackNamespace] = (function() { |
|
353 | 352 | $themeNamespace = config('backpack.ui.view_namespace'); |
354 | 353 | $themeFallbackNamespace = config('backpack.ui.view_namespace_fallback'); |
355 | 354 | |
@@ -366,8 +365,7 @@ discard block |
||
366 | 365 | // - fallback theme paths |
367 | 366 | // - ui path |
368 | 367 | $themeErrorPaths = $viewFinderHints[$themeNamespace] ?? []; |
369 | - $themeErrorPaths = $themeNamespace === $themeFallbackNamespace ? $themeErrorPaths : |
|
370 | - array_merge($viewFinderHints[$themeFallbackNamespace] ?? [], $themeErrorPaths); |
|
368 | + $themeErrorPaths = $themeNamespace === $themeFallbackNamespace ? $themeErrorPaths : array_merge($viewFinderHints[$themeFallbackNamespace] ?? [], $themeErrorPaths); |
|
371 | 369 | $uiErrorPaths = [base_path('vendor/backpack/crud/src/resources/views/ui')]; |
372 | 370 | $themeErrorPaths = array_merge($themeErrorPaths, $uiErrorPaths); |
373 | 371 |