@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid; |
4 | 4 | |
5 | -use Encore\Admin\Actions\GridAction; |
|
6 | -use Encore\Admin\Grid; |
|
7 | -use Encore\Admin\Grid\Tools\AbstractTool; |
|
8 | -use Encore\Admin\Grid\Tools\BatchActions; |
|
9 | -use Encore\Admin\Grid\Tools\FilterButton; |
|
10 | -use Illuminate\Contracts\Support\Htmlable; |
|
11 | -use Illuminate\Contracts\Support\Renderable; |
|
5 | +use Encore\Admin\Actions\GridAction; |
|
6 | +use Encore\Admin\Grid; |
|
7 | +use Encore\Admin\Grid\Tools\AbstractTool; |
|
8 | +use Encore\Admin\Grid\Tools\BatchActions; |
|
9 | +use Encore\Admin\Grid\Tools\FilterButton; |
|
10 | +use Illuminate\Contracts\Support\Htmlable; |
|
11 | +use Illuminate\Contracts\Support\Renderable; |
|
12 | 12 | use Illuminate\Support\Collection; |
13 | 13 | |
14 | 14 | class Tools implements Renderable |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function disableFilterButton(bool $disable = true) |
91 | 91 | { |
92 | - $this->tools = $this->tools->map(function ($tool) use ($disable) { |
|
92 | + $this->tools = $this->tools->map(function($tool) use ($disable) { |
|
93 | 93 | if ($tool instanceof FilterButton) { |
94 | 94 | return $tool->disable($disable); |
95 | 95 | } |
@@ -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 ''; |
@@ -71,7 +71,7 @@ |
||
71 | 71 | /** |
72 | 72 | * Add a batch action. |
73 | 73 | * |
74 | - * @param $title |
|
74 | + * @param BatchDelete $title |
|
75 | 75 | * @param BatchAction|null $action |
76 | 76 | * |
77 | 77 | * @return $this |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid\Tools; |
4 | 4 | |
5 | -use Encore\Admin\Admin; |
|
5 | +use Encore\Admin\Admin; |
|
6 | 6 | use Illuminate\Support\Collection; |
7 | 7 | |
8 | 8 | class BatchActions extends AbstractTool |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid\Tools; |
4 | 4 | |
5 | -use Encore\Admin\Admin; |
|
5 | +use Encore\Admin\Admin; |
|
6 | 6 | use Encore\Admin\Grid; |
7 | 7 | |
8 | 8 | class ExportButton extends AbstractTool |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid\Tools; |
4 | 4 | |
5 | -use Encore\Admin\Admin; |
|
6 | -use Encore\Admin\Grid; |
|
5 | +use Encore\Admin\Admin; |
|
6 | +use Encore\Admin\Grid; |
|
7 | 7 | use Illuminate\Support\Collection; |
8 | 8 | |
9 | 9 | class FixColumns |
@@ -78,7 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | $this->grid->setView($this->view); |
80 | 80 | |
81 | - return function (Grid $grid) { |
|
81 | + return function(Grid $grid) { |
|
82 | 82 | if ($this->head > 0) { |
83 | 83 | $this->left = $grid->visibleColumns()->slice(0, $this->head); |
84 | 84 | } |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid\Tools; |
4 | 4 | |
5 | -use Encore\Admin\Grid; |
|
6 | -use Illuminate\Contracts\Support\Htmlable; |
|
7 | -use Illuminate\Contracts\Support\Renderable; |
|
5 | +use Encore\Admin\Grid; |
|
6 | +use Illuminate\Contracts\Support\Htmlable; |
|
7 | +use Illuminate\Contracts\Support\Renderable; |
|
8 | 8 | use Illuminate\Database\Query\Builder; |
9 | 9 | |
10 | 10 | class Footer extends AbstractTool |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid\Tools; |
4 | 4 | |
5 | -use Encore\Admin\Grid; |
|
6 | -use Illuminate\Contracts\Support\Htmlable; |
|
7 | -use Illuminate\Contracts\Support\Renderable; |
|
5 | +use Encore\Admin\Grid; |
|
6 | +use Illuminate\Contracts\Support\Htmlable; |
|
7 | +use Illuminate\Contracts\Support\Renderable; |
|
8 | 8 | use Illuminate\Database\Query\Builder; |
9 | 9 | |
10 | 10 | class Header extends AbstractTool |
@@ -41,7 +41,7 @@ |
||
41 | 41 | /** |
42 | 42 | * Get Pagination links. |
43 | 43 | * |
44 | - * @return string |
|
44 | + * @return \Illuminate\Contracts\View\View |
|
45 | 45 | */ |
46 | 46 | protected function paginationLinks() |
47 | 47 | { |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid\Tools; |
4 | 4 | |
5 | -use Encore\Admin\Grid; |
|
5 | +use Encore\Admin\Grid; |
|
6 | 6 | use Illuminate\Pagination\LengthAwarePaginator; |
7 | 7 | |
8 | 8 | class Paginator extends AbstractTool |
@@ -71,7 +71,7 @@ |
||
71 | 71 | 'total' => $this->paginator->total(), |
72 | 72 | ]; |
73 | 73 | |
74 | - $parameters = collect($parameters)->flatMap(function ($parameter, $key) { |
|
74 | + $parameters = collect($parameters)->flatMap(function($parameter, $key) { |
|
75 | 75 | return [$key => "<b>$parameter</b>"]; |
76 | 76 | }); |
77 | 77 |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid\Tools; |
4 | 4 | |
5 | -use Encore\Admin\Admin; |
|
5 | +use Encore\Admin\Admin; |
|
6 | 6 | use Encore\Admin\Grid; |
7 | 7 | |
8 | 8 | class PerPageSelector extends AbstractTool |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | Admin::script($this->script()); |
69 | 69 | |
70 | - $options = $this->getOptions()->map(function ($option) { |
|
70 | + $options = $this->getOptions()->map(function($option) { |
|
71 | 71 | $selected = ($option == $this->perPage) ? 'selected' : ''; |
72 | 72 | $url = \request()->fullUrlWithQuery([$this->perPageName => $option]); |
73 | 73 |
@@ -34,6 +34,9 @@ |
||
34 | 34 | $this->fields = Collection::make(); |
35 | 35 | } |
36 | 36 | |
37 | + /** |
|
38 | + * @param string $placeholder |
|
39 | + */ |
|
37 | 40 | protected function formatPlaceholder($placeholder) |
38 | 41 | { |
39 | 42 | return array_filter((array) $placeholder); |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Grid\Tools; |
4 | 4 | |
5 | -use Encore\Admin\Admin; |
|
6 | -use Encore\Admin\Form\Field; |
|
7 | -use Encore\Admin\Form\Field\MultipleSelect; |
|
8 | -use Encore\Admin\Form\Field\Select; |
|
9 | -use Encore\Admin\Form\Field\Text; |
|
10 | -use Encore\Admin\Grid; |
|
11 | -use Illuminate\Contracts\Support\Renderable; |
|
5 | +use Encore\Admin\Admin; |
|
6 | +use Encore\Admin\Form\Field; |
|
7 | +use Encore\Admin\Form\Field\MultipleSelect; |
|
8 | +use Encore\Admin\Form\Field\Select; |
|
9 | +use Encore\Admin\Form\Field\Text; |
|
10 | +use Encore\Admin\Grid; |
|
11 | +use Illuminate\Contracts\Support\Renderable; |
|
12 | 12 | use Illuminate\Support\Collection; |
13 | 13 | |
14 | 14 | class QuickCreate implements Renderable |