@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | public function removeFilterByID($id) |
| 287 | 287 | { |
| 288 | - $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) { |
|
| 288 | + $this->filters = array_filter($this->filters, function(AbstractFilter $filter) use ($id) { |
|
| 289 | 289 | return $filter->getId() != $id; |
| 290 | 290 | }); |
| 291 | 291 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | { |
| 300 | 300 | $inputs = Arr::dot(request()->all()); |
| 301 | 301 | |
| 302 | - $inputs = array_filter($inputs, function ($input) { |
|
| 302 | + $inputs = array_filter($inputs, function($input) { |
|
| 303 | 303 | return $input !== '' && !is_null($input); |
| 304 | 304 | }); |
| 305 | 305 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - return tap(array_filter($conditions), function ($conditions) { |
|
| 330 | + return tap(array_filter($conditions), function($conditions) { |
|
| 331 | 331 | if (!empty($conditions)) { |
| 332 | 332 | $this->expand(); |
| 333 | 333 | } |
@@ -345,9 +345,9 @@ discard block |
||
| 345 | 345 | return $inputs; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | - $inputs = collect($inputs)->filter(function ($input, $key) { |
|
| 348 | + $inputs = collect($inputs)->filter(function($input, $key) { |
|
| 349 | 349 | return Str::startsWith($key, "{$this->name}_"); |
| 350 | - })->mapWithKeys(function ($val, $key) { |
|
| 350 | + })->mapWithKeys(function($val, $key) { |
|
| 351 | 351 | $key = str_replace("{$this->name}_", '', $key); |
| 352 | 352 | |
| 353 | 353 | return [$key => $val]; |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | */ |
| 418 | 418 | public function scope($key, $label = '') |
| 419 | 419 | { |
| 420 | - return tap(new Scope($key, $label), function (Scope $scope) { |
|
| 420 | + return tap(new Scope($key, $label), function(Scope $scope) { |
|
| 421 | 421 | return $this->scopes->push($scope); |
| 422 | 422 | }); |
| 423 | 423 | } |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | { |
| 442 | 442 | $key = request(Scope::QUERY_NAME); |
| 443 | 443 | |
| 444 | - return $this->scopes->first(function ($scope) use ($key) { |
|
| 444 | + return $this->scopes->first(function($scope) use ($key) { |
|
| 445 | 445 | return $scope->key == $key; |
| 446 | 446 | }); |
| 447 | 447 | } |
@@ -566,9 +566,9 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | $columns->push($pageKey); |
| 568 | 568 | |
| 569 | - $groupNames = collect($this->filters)->filter(function ($filter) { |
|
| 569 | + $groupNames = collect($this->filters)->filter(function($filter) { |
|
| 570 | 570 | return $filter instanceof Filter\Group; |
| 571 | - })->map(function (AbstractFilter $filter) { |
|
| 571 | + })->map(function(AbstractFilter $filter) { |
|
| 572 | 572 | return "{$filter->getId()}_group"; |
| 573 | 573 | }); |
| 574 | 574 | |
@@ -236,7 +236,7 @@ |
||
| 236 | 236 | public static function import() |
| 237 | 237 | { |
| 238 | 238 | $extension = static::getInstance(); |
| 239 | - DB::transaction(function () use ($extension) { |
|
| 239 | + DB::transaction(function() use ($extension) { |
|
| 240 | 240 | if ($menu = $extension->menu()) { |
| 241 | 241 | if ($extension->validateMenu($menu)) { |
| 242 | 242 | extract($menu); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public function removeFields($fields) |
| 50 | 50 | { |
| 51 | - $this->fields = $this->fields->reject(function (Field $field) use ($fields) { |
|
| 51 | + $this->fields = $this->fields->reject(function(Field $field) use ($fields) { |
|
| 52 | 52 | return in_array($field->column(), $fields); |
| 53 | 53 | }); |
| 54 | 54 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | if (empty($selectedOption)) { |
| 43 | 43 | $selected = $this->choice('Please choose a role for the user', $selectedOption, null, null, true); |
| 44 | 44 | |
| 45 | - $roles = $roles->filter(function ($role) use ($selected) { |
|
| 45 | + $roles = $roles->filter(function($role) use ($selected) { |
|
| 46 | 46 | return in_array($role->name, $selected); |
| 47 | 47 | }); |
| 48 | 48 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | return $ret; |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | - collect(explode(',', $id))->filter()->each(function ($id) { |
|
| 379 | + collect(explode(',', $id))->filter()->each(function($id) { |
|
| 380 | 380 | $builder = $this->model()->newQuery(); |
| 381 | 381 | |
| 382 | 382 | if ($this->isSoftDeletes) { |
@@ -429,9 +429,9 @@ discard block |
||
| 429 | 429 | |
| 430 | 430 | $data = $model->toArray(); |
| 431 | 431 | |
| 432 | - $this->builder->fields()->filter(function ($field) { |
|
| 432 | + $this->builder->fields()->filter(function($field) { |
|
| 433 | 433 | return $field instanceof Field\File; |
| 434 | - })->each(function (Field\File $file) use ($data) { |
|
| 434 | + })->each(function(Field\File $file) use ($data) { |
|
| 435 | 435 | $file->setOriginal($data); |
| 436 | 436 | |
| 437 | 437 | $file->destroy(); |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | return $response; |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | - DB::transaction(function () { |
|
| 459 | + DB::transaction(function() { |
|
| 460 | 460 | $inserts = $this->prepareInsert($this->updates); |
| 461 | 461 | |
| 462 | 462 | foreach ($inserts as $column => $value) { |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | return $response; |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | - DB::transaction(function () { |
|
| 629 | + DB::transaction(function() { |
|
| 630 | 630 | $updates = $this->prepareUpdate($this->updates); |
| 631 | 631 | |
| 632 | 632 | foreach ($updates as $column => $value) { |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | protected function getFieldByColumn($column) |
| 1107 | 1107 | { |
| 1108 | 1108 | return $this->builder->fields()->first( |
| 1109 | - function (Field $field) use ($column) { |
|
| 1109 | + function(Field $field) use ($column) { |
|
| 1110 | 1110 | if (is_array($field->column())) { |
| 1111 | 1111 | return in_array($column, $field->column()); |
| 1112 | 1112 | } |
@@ -1127,7 +1127,7 @@ discard block |
||
| 1127 | 1127 | |
| 1128 | 1128 | $values = $this->model->toArray(); |
| 1129 | 1129 | |
| 1130 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
| 1130 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
| 1131 | 1131 | $field->setOriginal($values); |
| 1132 | 1132 | }); |
| 1133 | 1133 | } |
@@ -1157,7 +1157,7 @@ discard block |
||
| 1157 | 1157 | |
| 1158 | 1158 | $data = $this->model->toArray(); |
| 1159 | 1159 | |
| 1160 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
| 1160 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
| 1161 | 1161 | if (!in_array($field->column(), $this->ignored, true)) { |
| 1162 | 1162 | $field->fill($data); |
| 1163 | 1163 | } |
@@ -1301,7 +1301,7 @@ discard block |
||
| 1301 | 1301 | */ |
| 1302 | 1302 | public function setWidth($fieldWidth = 8, $labelWidth = 2): self |
| 1303 | 1303 | { |
| 1304 | - $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
| 1304 | + $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
| 1305 | 1305 | /* @var Field $field */ |
| 1306 | 1306 | $field->setWidth($fieldWidth, $labelWidth); |
| 1307 | 1307 | }); |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | public function field($name) |
| 337 | 337 | { |
| 338 | - return $this->fields()->first(function (Field $field) use ($name) { |
|
| 338 | + return $this->fields()->first(function(Field $field) use ($name) { |
|
| 339 | 339 | return $field->column() === $name; |
| 340 | 340 | }); |
| 341 | 341 | } |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | |
| 535 | 535 | $this->form->getLayout()->removeReservedFields($reservedColumns); |
| 536 | 536 | |
| 537 | - $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) { |
|
| 537 | + $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) { |
|
| 538 | 538 | return in_array($field->column(), $reservedColumns, true); |
| 539 | 539 | }); |
| 540 | 540 | } |