@@ -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 | |
@@ -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 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | * Get or set option for grid. |
| 261 | 261 | * |
| 262 | 262 | * @param string $key |
| 263 | - * @param mixed $value |
|
| 263 | + * @param boolean $value |
|
| 264 | 264 | * |
| 265 | 265 | * @return $this|mixed |
| 266 | 266 | */ |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | /** |
| 465 | 465 | * Get the grid paginator. |
| 466 | 466 | * |
| 467 | - * @return mixed |
|
| 467 | + * @return Tools\Paginator |
|
| 468 | 468 | */ |
| 469 | 469 | public function paginator() |
| 470 | 470 | { |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | /** |
| 517 | 517 | * Set grid action callback. |
| 518 | 518 | * |
| 519 | - * @param Closure|string $actions |
|
| 519 | + * @param Closure $actions |
|
| 520 | 520 | * |
| 521 | 521 | * @return $this |
| 522 | 522 | */ |
@@ -876,8 +876,8 @@ discard block |
||
| 876 | 876 | /** |
| 877 | 877 | * Dynamically add columns to the grid view. |
| 878 | 878 | * |
| 879 | - * @param $method |
|
| 880 | - * @param $arguments |
|
| 879 | + * @param string $method |
|
| 880 | + * @param string[] $arguments |
|
| 881 | 881 | * |
| 882 | 882 | * @return Column |
| 883 | 883 | */ |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | @if($errors->hasBag('exception') && config('app.debug') == true) |
| 2 | - <?php $error = $errors->getBag('exception');?> |
|
| 2 | + <?php $error = $errors->getBag('exception'); ?> |
|
| 3 | 3 | <div class="alert alert-warning alert-dismissable"> |
| 4 | 4 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
| 5 | 5 | <h4> |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function disableFilterButton(bool $disable = true) |
| 87 | 87 | { |
| 88 | - $this->tools = $this->tools->map(function ($tool) use ($disable) { |
|
| 88 | + $this->tools = $this->tools->map(function($tool) use ($disable) { |
|
| 89 | 89 | if ($tool instanceof FilterButton) { |
| 90 | 90 | return $tool->disable($disable); |
| 91 | 91 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function disableRefreshButton(bool $disable = true) |
| 103 | 103 | { |
| 104 | - $this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) { |
|
| 104 | + $this->tools = $this->tools->map(function(AbstractTool $tool) use ($disable) { |
|
| 105 | 105 | if ($tool instanceof RefreshButton) { |
| 106 | 106 | return $tool->disable($disable); |
| 107 | 107 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function disableBatchActions(bool $disable = true) |
| 119 | 119 | { |
| 120 | - $this->tools = $this->tools->map(function ($tool) use ($disable) { |
|
| 120 | + $this->tools = $this->tools->map(function($tool) use ($disable) { |
|
| 121 | 121 | if ($tool instanceof BatchActions) { |
| 122 | 122 | return $tool->disable($disable); |
| 123 | 123 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function batch(\Closure $closure) |
| 133 | 133 | { |
| 134 | - call_user_func($closure, $this->tools->first(function ($tool) { |
|
| 134 | + call_user_func($closure, $this->tools->first(function($tool) { |
|
| 135 | 135 | return $tool instanceof BatchActions; |
| 136 | 136 | })); |
| 137 | 137 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function render() |
| 145 | 145 | { |
| 146 | - return $this->tools->map(function ($tool) { |
|
| 146 | + return $this->tools->map(function($tool) { |
|
| 147 | 147 | if ($tool instanceof AbstractTool) { |
| 148 | 148 | if (!$tool->allowed()) { |
| 149 | 149 | return ''; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | return $next($request); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (!Admin::user()->allPermissions()->first(function ($permission) use ($request) { |
|
| 36 | + if (!Admin::user()->allPermissions()->first(function($permission) use ($request) { |
|
| 37 | 37 | return $permission->shouldPassThrough($request); |
| 38 | 38 | })) { |
| 39 | 39 | Checker::error(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function checkRoutePermission(Request $request) |
| 54 | 54 | { |
| 55 | - if (!$middleware = collect($request->route()->middleware())->first(function ($middleware) { |
|
| 55 | + if (!$middleware = collect($request->route()->middleware())->first(function($middleware) { |
|
| 56 | 56 | return Str::startsWith($middleware, $this->middlewarePrefix); |
| 57 | 57 | })) { |
| 58 | 58 | return false; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | return collect($excepts) |
| 89 | 89 | ->map('admin_base_path') |
| 90 | - ->contains(function ($except) use ($request) { |
|
| 90 | + ->contains(function($except) use ($request) { |
|
| 91 | 91 | if ($except !== '/') { |
| 92 | 92 | $except = trim($except, '/'); |
| 93 | 93 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | return collect($excepts) |
| 45 | 45 | ->map('admin_base_path') |
| 46 | - ->contains(function ($except) use ($request) { |
|
| 46 | + ->contains(function($except) use ($request) { |
|
| 47 | 47 | if ($except !== '/') { |
| 48 | 48 | $except = trim($except, '/'); |
| 49 | 49 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $this->setupScript(); |
| 43 | 43 | |
| 44 | - $lists = $columns->map(function ($val, $key) use ($show) { |
|
| 44 | + $lists = $columns->map(function($val, $key) use ($show) { |
|
| 45 | 45 | if (empty($show)) { |
| 46 | 46 | $checked = 'checked'; |
| 47 | 47 | } else { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | protected function getGridColumns() |
| 94 | 94 | { |
| 95 | - return $this->grid->columns()->map(function (Grid\Column $column) { |
|
| 95 | + return $this->grid->columns()->map(function(Grid\Column $column) { |
|
| 96 | 96 | $name = $column->getName(); |
| 97 | 97 | |
| 98 | 98 | if (in_array($name, ['__row_selector__', '__actions__'])) { |