@@ -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 | } |
@@ -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 | } |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | */ |
| 113 | 113 | protected static function bootHasPermissions() |
| 114 | 114 | { |
| 115 | - static::deleting(function ($model) { |
|
| 115 | + static::deleting(function($model) { |
|
| 116 | 116 | $model->roles()->detach(); |
| 117 | 117 | |
| 118 | 118 | $model->permissions()->detach(); |
@@ -347,9 +347,9 @@ discard block |
||
| 347 | 347 | |
| 348 | 348 | $this->setSort(); |
| 349 | 349 | |
| 350 | - $this->queries->reject(function ($query) { |
|
| 350 | + $this->queries->reject(function($query) { |
|
| 351 | 351 | return $query['method'] == 'paginate'; |
| 352 | - })->each(function ($query) { |
|
| 352 | + })->each(function($query) { |
|
| 353 | 353 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
| 354 | 354 | }); |
| 355 | 355 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | $this->setSort(); |
| 401 | 401 | $this->setPaginate(); |
| 402 | 402 | |
| 403 | - $this->queries->unique()->each(function ($query) { |
|
| 403 | + $this->queries->unique()->each(function($query) { |
|
| 404 | 404 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
| 405 | 405 | }); |
| 406 | 406 | |
@@ -430,9 +430,9 @@ discard block |
||
| 430 | 430 | |
| 431 | 431 | $queryBuilder = $this->originalModel; |
| 432 | 432 | |
| 433 | - $this->queries->reject(function ($query) { |
|
| 433 | + $this->queries->reject(function($query) { |
|
| 434 | 434 | return in_array($query['method'], ['get', 'paginate']); |
| 435 | - })->each(function ($query) use (&$queryBuilder) { |
|
| 435 | + })->each(function($query) use (&$queryBuilder) { |
|
| 436 | 436 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
| 437 | 437 | }); |
| 438 | 438 | |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | { |
| 467 | 467 | $paginate = $this->findQueryByMethod('paginate'); |
| 468 | 468 | |
| 469 | - $this->queries = $this->queries->reject(function ($query) { |
|
| 469 | + $this->queries = $this->queries->reject(function($query) { |
|
| 470 | 470 | return $query['method'] == 'paginate'; |
| 471 | 471 | }); |
| 472 | 472 | |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | */ |
| 525 | 525 | protected function findQueryByMethod($method) |
| 526 | 526 | { |
| 527 | - return $this->queries->first(function ($query) use ($method) { |
|
| 527 | + return $this->queries->first(function($query) use ($method) { |
|
| 528 | 528 | return $query['method'] == $method; |
| 529 | 529 | }); |
| 530 | 530 | } |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | $columnNameContainsDots = Str::contains($columnName, '.'); |
| 550 | - $isRelation = $this->queries->contains(function ($query) use ($columnName) { |
|
| 550 | + $isRelation = $this->queries->contains(function($query) use ($columnName) { |
|
| 551 | 551 | return $query['method'] === 'with' && in_array($columnName, $query['arguments'], true); |
| 552 | 552 | }); |
| 553 | 553 | if ($columnNameContainsDots === true && $isRelation) { |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | { |
| 594 | 594 | list($relationName, $relationColumn) = explode('.', $column); |
| 595 | 595 | |
| 596 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
| 596 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
| 597 | 597 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
| 598 | 598 | })) { |
| 599 | 599 | $relation = $this->model->$relationName(); |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | */ |
| 628 | 628 | public function resetOrderBy() |
| 629 | 629 | { |
| 630 | - $this->queries = $this->queries->reject(function ($query) { |
|
| 630 | + $this->queries = $this->queries->reject(function($query) { |
|
| 631 | 631 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
| 632 | 632 | }); |
| 633 | 633 | } |
@@ -475,7 +475,7 @@ |
||
| 475 | 475 | $relation = substr($this->column, 0, strrpos($this->column, '.')); |
| 476 | 476 | $args[0] = last(explode('.', $this->column)); |
| 477 | 477 | |
| 478 | - return ['whereHas' => [$relation, function ($relation) use ($args) { |
|
| 478 | + return ['whereHas' => [$relation, function($relation) use ($args) { |
|
| 479 | 479 | call_user_func_array([$relation, $this->query], $args); |
| 480 | 480 | }]]; |
| 481 | 481 | } |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | return $content |
| 27 | 27 | ->title(trans('admin.menu')) |
| 28 | 28 | ->description(trans('admin.list')) |
| 29 | - ->row(function (Row $row) { |
|
| 29 | + ->row(function(Row $row) { |
|
| 30 | 30 | $row->column(6, $this->treeView()->render()); |
| 31 | 31 | |
| 32 | - $row->column(6, function (Column $column) { |
|
| 32 | + $row->column(6, function(Column $column) { |
|
| 33 | 33 | $form = new \Encore\Admin\Widgets\Form(); |
| 34 | 34 | $form->action(admin_url('auth/menu')); |
| 35 | 35 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $tree->disableCreate(); |
| 77 | 77 | |
| 78 | - $tree->branch(function ($branch) { |
|
| 78 | + $tree->branch(function($branch) { |
|
| 79 | 79 | $payload = "<i class='fa {$branch['icon']}'></i> <strong>{$branch['title']}</strong>"; |
| 80 | 80 | |
| 81 | 81 | if (!isset($branch['children'])) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | // for create or update |
| 156 | 156 | if ($this->pathColumn) { |
| 157 | - $targets = array_map(function ($target) { |
|
| 157 | + $targets = array_map(function($target) { |
|
| 158 | 158 | return [$this->pathColumn => $target]; |
| 159 | 159 | }, $targets); |
| 160 | 160 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | $this->name = $this->getStoreName($file); |
| 187 | 187 | |
| 188 | - return tap($this->upload($file), function () { |
|
| 188 | + return tap($this->upload($file), function() { |
|
| 189 | 189 | $this->name = null; |
| 190 | 190 | }); |
| 191 | 191 | } |