@@ -213,10 +213,10 @@ |
||
213 | 213 | 'middleware' => config('admin.route.middleware'), |
214 | 214 | ]; |
215 | 215 | |
216 | - app('router')->group($attributes, function ($router) { |
|
216 | + app('router')->group($attributes, function($router) { |
|
217 | 217 | |
218 | 218 | /* @var \Illuminate\Routing\Router $router */ |
219 | - $router->namespace('Encore\Admin\Controllers')->group(function ($router) { |
|
219 | + $router->namespace('Encore\Admin\Controllers')->group(function($router) { |
|
220 | 220 | |
221 | 221 | /* @var \Illuminate\Routing\Router $router */ |
222 | 222 | $router->resource('auth/users', 'UserController'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->filter()->map(function ($path) use ($server, $width, $height) { |
|
16 | + return collect((array) $this->value)->filter()->map(function($path) use ($server, $width, $height) { |
|
17 | 17 | if (url()->isValidUrl($path) || strpos($path, 'data:image') === 0) { |
18 | 18 | $src = $path; |
19 | 19 | } elseif ($server) { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | */ |
260 | 260 | protected function removeFilterByID($id) |
261 | 261 | { |
262 | - $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) { |
|
262 | + $this->filters = array_filter($this->filters, function(AbstractFilter $filter) use ($id) { |
|
263 | 263 | return $filter->getId() != $id; |
264 | 264 | }); |
265 | 265 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | { |
274 | 274 | $inputs = array_dot(Input::all()); |
275 | 275 | |
276 | - $inputs = array_filter($inputs, function ($input) { |
|
276 | + $inputs = array_filter($inputs, function($input) { |
|
277 | 277 | return $input !== '' && !is_null($input); |
278 | 278 | }); |
279 | 279 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | } |
302 | 302 | } |
303 | 303 | |
304 | - return tap(array_filter($conditions), function ($conditions) { |
|
304 | + return tap(array_filter($conditions), function($conditions) { |
|
305 | 305 | if (!empty($conditions)) { |
306 | 306 | $this->expand(); |
307 | 307 | } |
@@ -319,9 +319,9 @@ discard block |
||
319 | 319 | return $inputs; |
320 | 320 | } |
321 | 321 | |
322 | - $inputs = collect($inputs)->filter(function ($input, $key) { |
|
322 | + $inputs = collect($inputs)->filter(function($input, $key) { |
|
323 | 323 | return starts_with($key, "{$this->name}_"); |
324 | - })->mapWithKeys(function ($val, $key) { |
|
324 | + })->mapWithKeys(function($val, $key) { |
|
325 | 325 | $key = str_replace("{$this->name}_", '', $key); |
326 | 326 | |
327 | 327 | return [$key => $val]; |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | */ |
392 | 392 | public function scope($key, $label = '') |
393 | 393 | { |
394 | - return tap(new Scope($key, $label), function (Scope $scope) { |
|
394 | + return tap(new Scope($key, $label), function(Scope $scope) { |
|
395 | 395 | return $this->scopes->push($scope); |
396 | 396 | }); |
397 | 397 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | { |
416 | 416 | $key = request(Scope::QUERY_NAME); |
417 | 417 | |
418 | - return $this->scopes->first(function ($scope) use ($key) { |
|
418 | + return $this->scopes->first(function($scope) use ($key) { |
|
419 | 419 | return $scope->key == $key; |
420 | 420 | }); |
421 | 421 | } |
@@ -535,9 +535,9 @@ discard block |
||
535 | 535 | |
536 | 536 | $columns->push($pageKey); |
537 | 537 | |
538 | - $groupNames = collect($this->filters)->filter(function ($filter) { |
|
538 | + $groupNames = collect($this->filters)->filter(function($filter) { |
|
539 | 539 | return $filter instanceof Group; |
540 | - })->map(function (AbstractFilter $filter) { |
|
540 | + })->map(function(AbstractFilter $filter) { |
|
541 | 541 | return "{$filter->getId()}_group"; |
542 | 542 | }); |
543 | 543 |
@@ -184,7 +184,7 @@ |
||
184 | 184 | $attributes = array_merge($attributes, $this->attributes); |
185 | 185 | } |
186 | 186 | |
187 | - $attributes = collect($attributes)->map(function ($attribute, $name) { |
|
187 | + $attributes = collect($attributes)->map(function($attribute, $name) { |
|
188 | 188 | return "$name='$attribute'"; |
189 | 189 | })->implode(' '); |
190 | 190 |
@@ -89,7 +89,7 @@ |
||
89 | 89 | $fields = \DB::getSchemaBuilder()->getColumnListing($table); |
90 | 90 | $fields = array_diff($fields, $exceptFields); |
91 | 91 | |
92 | - $array = \DB::table($table)->get($fields)->map(function ($item) { |
|
92 | + $array = \DB::table($table)->get($fields)->map(function($item) { |
|
93 | 93 | return (array) $item; |
94 | 94 | })->all(); |
95 | 95 |
@@ -640,7 +640,7 @@ |
||
640 | 640 | } |
641 | 641 | |
642 | 642 | /* Build row elements */ |
643 | - $template = array_reduce($fields, function ($all, $field) { |
|
643 | + $template = array_reduce($fields, function($all, $field) { |
|
644 | 644 | $all .= "<td>{$field}</td>"; |
645 | 645 | |
646 | 646 | return $all; |
@@ -112,7 +112,7 @@ |
||
112 | 112 | protected function startColumn() |
113 | 113 | { |
114 | 114 | // get class name using width array |
115 | - $classnName = collect($this->width)->map(function ($value, $key) { |
|
115 | + $classnName = collect($this->width)->map(function($value, $key) { |
|
116 | 116 | return "col-$key-$value"; |
117 | 117 | })->implode(' '); |
118 | 118 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | $this->setupScript($show, $columns); |
40 | 40 | |
41 | - $lists = $columns->map(function ($val, $key) use ($show) { |
|
41 | + $lists = $columns->map(function($val, $key) use ($show) { |
|
42 | 42 | if (empty($show)) { |
43 | 43 | $checked = 'checked'; |
44 | 44 | } else { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | protected function getGridColumns() |
75 | 75 | { |
76 | - return $this->grid->columns()->map(function (Grid\Column $column) { |
|
76 | + return $this->grid->columns()->map(function(Grid\Column $column) { |
|
77 | 77 | $name = $column->getName(); |
78 | 78 | |
79 | 79 | if (in_array($name, ['__row_selector__', '__actions__'])) { |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | |
372 | 372 | array_push($visible, '__row_selector__', '__actions__'); |
373 | 373 | |
374 | - return $this->columns->filter(function (Column $column) use ($visible) { |
|
374 | + return $this->columns->filter(function(Column $column) use ($visible) { |
|
375 | 375 | return in_array($column->getName(), $visible); |
376 | 376 | }); |
377 | 377 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | array_push($visible, '__row_selector__', '__actions__'); |
393 | 393 | |
394 | - return collect($this->columnNames)->filter(function ($column) use ($visible) { |
|
394 | + return collect($this->columnNames)->filter(function($column) use ($visible) { |
|
395 | 395 | return in_array($column, $visible); |
396 | 396 | }); |
397 | 397 | } |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | $column = new Column($column, $label); |
410 | 410 | $column->setGrid($this); |
411 | 411 | |
412 | - return tap($column, function ($value) { |
|
412 | + return tap($column, function($value) { |
|
413 | 413 | $this->columns->push($value); |
414 | 414 | }); |
415 | 415 | } |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | $column = new Column($column, $label); |
428 | 428 | $column->setGrid($this); |
429 | 429 | |
430 | - return tap($column, function ($value) { |
|
430 | + return tap($column, function($value) { |
|
431 | 431 | $this->columns->prepend($value); |
432 | 432 | }); |
433 | 433 | } |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | |
585 | 585 | Column::setOriginalGridModels($collection); |
586 | 586 | |
587 | - $this->columns->map(function (Column $column) use (&$data) { |
|
587 | + $this->columns->map(function(Column $column) use (&$data) { |
|
588 | 588 | $data = $column->fill($data); |
589 | 589 | |
590 | 590 | $this->columnNames[] = $column->getName(); |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | */ |
689 | 689 | protected function buildRows(array $data) |
690 | 690 | { |
691 | - $this->rows = collect($data)->map(function ($model, $number) { |
|
691 | + $this->rows = collect($data)->map(function($model, $number) { |
|
692 | 692 | return new Row($number, $model); |
693 | 693 | }); |
694 | 694 |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * Get or set option for grid. |
277 | 277 | * |
278 | 278 | * @param string $key |
279 | - * @param mixed $value |
|
279 | + * @param boolean $value |
|
280 | 280 | * |
281 | 281 | * @return $this|mixed |
282 | 282 | */ |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | /** |
467 | 467 | * Get the grid paginator. |
468 | 468 | * |
469 | - * @return mixed |
|
469 | + * @return Tools\Paginator |
|
470 | 470 | */ |
471 | 471 | public function paginator() |
472 | 472 | { |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | /** |
519 | 519 | * Set grid action callback. |
520 | 520 | * |
521 | - * @param Closure|string $actions |
|
521 | + * @param Closure $actions |
|
522 | 522 | * |
523 | 523 | * @return $this |
524 | 524 | */ |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | * |
646 | 646 | * @param bool $toArray |
647 | 647 | * |
648 | - * @return array|Collection|mixed |
|
648 | + * @return Collection |
|
649 | 649 | */ |
650 | 650 | public function processFilter($toArray = true) |
651 | 651 | { |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | * |
896 | 896 | * @param Closure|null $closure |
897 | 897 | * |
898 | - * @return $this|Closure |
|
898 | + * @return callable |
|
899 | 899 | */ |
900 | 900 | public function header(Closure $closure = null) |
901 | 901 | { |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | * |
928 | 928 | * @param Closure|null $closure |
929 | 929 | * |
930 | - * @return $this|Closure |
|
930 | + * @return callable |
|
931 | 931 | */ |
932 | 932 | public function footer(Closure $closure = null) |
933 | 933 | { |