@@ -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__'])) { |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | $grid->slug(trans('admin.slug')); |
91 | 91 | $grid->name(trans('admin.name')); |
92 | 92 | |
93 | - $grid->http_path(trans('admin.route'))->display(function ($path) { |
|
94 | - return collect(explode("\n", $path))->map(function ($path) { |
|
93 | + $grid->http_path(trans('admin.route'))->display(function($path) { |
|
94 | + return collect(explode("\n", $path))->map(function($path) { |
|
95 | 95 | $method = $this->http_method ?: ['ANY']; |
96 | 96 | |
97 | 97 | if (Str::contains($path, ':')) { |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | $method = explode(',', $method); |
100 | 100 | } |
101 | 101 | |
102 | - $method = collect($method)->map(function ($name) { |
|
102 | + $method = collect($method)->map(function($name) { |
|
103 | 103 | return strtoupper($name); |
104 | - })->map(function ($name) { |
|
104 | + })->map(function($name) { |
|
105 | 105 | return "<span class='label label-primary'>{$name}</span>"; |
106 | 106 | })->implode(' '); |
107 | 107 | |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | $grid->created_at(trans('admin.created_at')); |
117 | 117 | $grid->updated_at(trans('admin.updated_at')); |
118 | 118 | |
119 | - $grid->tools(function (Grid\Tools $tools) { |
|
120 | - $tools->batch(function (Grid\Tools\BatchActions $actions) { |
|
119 | + $grid->tools(function(Grid\Tools $tools) { |
|
120 | + $tools->batch(function(Grid\Tools\BatchActions $actions) { |
|
121 | 121 | $actions->disableDelete(); |
122 | 122 | }); |
123 | 123 | }); |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | $show->slug(trans('admin.slug')); |
143 | 143 | $show->name(trans('admin.name')); |
144 | 144 | |
145 | - $show->http_path(trans('admin.route'))->as(function ($path) { |
|
146 | - return collect(explode("\r\n", $path))->map(function ($path) { |
|
145 | + $show->http_path(trans('admin.route'))->as(function($path) { |
|
146 | + return collect(explode("\r\n", $path))->map(function($path) { |
|
147 | 147 | $method = $this->http_method ?: ['ANY']; |
148 | 148 | |
149 | 149 | if (Str::contains($path, ':')) { |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | $method = explode(',', $method); |
152 | 152 | } |
153 | 153 | |
154 | - $method = collect($method)->map(function ($name) { |
|
154 | + $method = collect($method)->map(function($name) { |
|
155 | 155 | return strtoupper($name); |
156 | - })->map(function ($name) { |
|
156 | + })->map(function($name) { |
|
157 | 157 | return "<span class='label label-primary'>{$name}</span>"; |
158 | 158 | })->implode(' '); |
159 | 159 |
@@ -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 |
@@ -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 (AbstractTool $tool) use ($disable) { |
|
88 | + $this->tools = $this->tools->map(function(AbstractTool $tool) use ($disable) { |
|
89 | 89 | if ($tool instanceof FilterButton) { |
90 | 90 | return $tool->disable($disable); |
91 | 91 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function disableRefreshButton(bool $disable = true) |
102 | 102 | { |
103 | - $this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) { |
|
103 | + $this->tools = $this->tools->map(function(AbstractTool $tool) use ($disable) { |
|
104 | 104 | if ($tool instanceof RefreshButton) { |
105 | 105 | return $tool->disable($disable); |
106 | 106 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function disableBatchActions(bool $disable = true) |
117 | 117 | { |
118 | - $this->tools = $this->tools->map(function ($tool) use ($disable) { |
|
118 | + $this->tools = $this->tools->map(function($tool) use ($disable) { |
|
119 | 119 | if ($tool instanceof BatchActions) { |
120 | 120 | return $tool->disable($disable); |
121 | 121 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function batch(\Closure $closure) |
130 | 130 | { |
131 | - call_user_func($closure, $this->tools->first(function ($tool) { |
|
131 | + call_user_func($closure, $this->tools->first(function($tool) { |
|
132 | 132 | return $tool instanceof BatchActions; |
133 | 133 | })); |
134 | 134 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public function render() |
142 | 142 | { |
143 | - return $this->tools->map(function ($tool) { |
|
143 | + return $this->tools->map(function($tool) { |
|
144 | 144 | if ($tool instanceof AbstractTool) { |
145 | 145 | if (!$tool->allowed()) { |
146 | 146 | return ''; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | protected function removeFilterByID($id) |
273 | 273 | { |
274 | - $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) { |
|
274 | + $this->filters = array_filter($this->filters, function(AbstractFilter $filter) use ($id) { |
|
275 | 275 | return $filter->getId() != $id; |
276 | 276 | }); |
277 | 277 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | { |
286 | 286 | $inputs = array_dot(Input::all()); |
287 | 287 | |
288 | - $inputs = array_filter($inputs, function ($input) { |
|
288 | + $inputs = array_filter($inputs, function($input) { |
|
289 | 289 | return $input !== '' && !is_null($input); |
290 | 290 | }); |
291 | 291 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | } |
315 | 315 | |
316 | - return tap(array_filter($conditions), function ($conditions) { |
|
316 | + return tap(array_filter($conditions), function($conditions) { |
|
317 | 317 | if (!empty($conditions)) { |
318 | 318 | $this->expand(); |
319 | 319 | } |
@@ -331,9 +331,9 @@ discard block |
||
331 | 331 | return $inputs; |
332 | 332 | } |
333 | 333 | |
334 | - $inputs = collect($inputs)->filter(function ($input, $key) { |
|
334 | + $inputs = collect($inputs)->filter(function($input, $key) { |
|
335 | 335 | return starts_with($key, "{$this->name}_"); |
336 | - })->mapWithKeys(function ($val, $key) { |
|
336 | + })->mapWithKeys(function($val, $key) { |
|
337 | 337 | $key = str_replace("{$this->name}_", '', $key); |
338 | 338 | |
339 | 339 | return [$key => $val]; |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | */ |
404 | 404 | public function scope($key, $label = '') |
405 | 405 | { |
406 | - return tap(new Scope($key, $label), function (Scope $scope) { |
|
406 | + return tap(new Scope($key, $label), function(Scope $scope) { |
|
407 | 407 | return $this->scopes->push($scope); |
408 | 408 | }); |
409 | 409 | } |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | { |
428 | 428 | $key = request(Scope::QUERY_NAME); |
429 | 429 | |
430 | - return $this->scopes->first(function ($scope) use ($key) { |
|
430 | + return $this->scopes->first(function($scope) use ($key) { |
|
431 | 431 | return $scope->key == $key; |
432 | 432 | }); |
433 | 433 | } |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | |
548 | 548 | $columns->push($pageKey); |
549 | 549 | |
550 | - $groupNames = collect($this->filters)->filter(function ($filter) { |
|
550 | + $groupNames = collect($this->filters)->filter(function($filter) { |
|
551 | 551 | return $filter instanceof Group; |
552 | - })->map(function (AbstractFilter $filter) { |
|
552 | + })->map(function(AbstractFilter $filter) { |
|
553 | 553 | return "{$filter->getId()}_group"; |
554 | 554 | }); |
555 | 555 | |
@@ -581,17 +581,17 @@ discard block |
||
581 | 581 | $keys = $keys->toArray(); |
582 | 582 | } |
583 | 583 | |
584 | - $keys = (array)$keys; |
|
584 | + $keys = (array) $keys; |
|
585 | 585 | |
586 | 586 | $request = request(); |
587 | 587 | |
588 | 588 | $query = $request->query(); |
589 | 589 | array_forget($query, $keys); |
590 | 590 | |
591 | - $question = $request->getBaseUrl() . $request->getPathInfo() == '/' ? '/?' : '?'; |
|
591 | + $question = $request->getBaseUrl().$request->getPathInfo() == '/' ? '/?' : '?'; |
|
592 | 592 | |
593 | 593 | return count($request->query()) > 0 |
594 | - ? $request->url() . $question . http_build_query($query) |
|
594 | + ? $request->url().$question.http_build_query($query) |
|
595 | 595 | : $request->fullUrl(); |
596 | 596 | } |
597 | 597 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | public static function extend($name, $filterClass) |
603 | 603 | { |
604 | 604 | if (!is_subclass_of($filterClass, AbstractFilter::class)) { |
605 | - throw new \InvalidArgumentException("The class [$filterClass] must be a type of " . AbstractFilter::class . '.'); |
|
605 | + throw new \InvalidArgumentException("The class [$filterClass] must be a type of ".AbstractFilter::class.'.'); |
|
606 | 606 | } |
607 | 607 | |
608 | 608 | static::$supports[$name] = $filterClass; |