@@ -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 | { |
@@ -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 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function up() |
| 23 | 23 | { |
| 24 | - Schema::create(config('admin.database.users_table'), function (Blueprint $table) { |
|
| 24 | + Schema::create(config('admin.database.users_table'), function(Blueprint $table) { |
|
| 25 | 25 | $table->increments('id'); |
| 26 | 26 | $table->string('username', 190)->unique(); |
| 27 | 27 | $table->string('password', 60); |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | $table->timestamps(); |
| 32 | 32 | }); |
| 33 | 33 | |
| 34 | - Schema::create(config('admin.database.roles_table'), function (Blueprint $table) { |
|
| 34 | + Schema::create(config('admin.database.roles_table'), function(Blueprint $table) { |
|
| 35 | 35 | $table->increments('id'); |
| 36 | 36 | $table->string('name', 50)->unique(); |
| 37 | 37 | $table->string('slug', 50); |
| 38 | 38 | $table->timestamps(); |
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | - Schema::create(config('admin.database.permissions_table'), function (Blueprint $table) { |
|
| 41 | + Schema::create(config('admin.database.permissions_table'), function(Blueprint $table) { |
|
| 42 | 42 | $table->increments('id'); |
| 43 | 43 | $table->string('name', 50)->unique(); |
| 44 | 44 | $table->string('slug', 50); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $table->timestamps(); |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - Schema::create(config('admin.database.menu_table'), function (Blueprint $table) { |
|
| 50 | + Schema::create(config('admin.database.menu_table'), function(Blueprint $table) { |
|
| 51 | 51 | $table->increments('id'); |
| 52 | 52 | $table->integer('parent_id')->default(0); |
| 53 | 53 | $table->integer('order')->default(0); |
@@ -59,35 +59,35 @@ discard block |
||
| 59 | 59 | $table->timestamps(); |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | - Schema::create(config('admin.database.role_users_table'), function (Blueprint $table) { |
|
| 62 | + Schema::create(config('admin.database.role_users_table'), function(Blueprint $table) { |
|
| 63 | 63 | $table->integer('role_id'); |
| 64 | 64 | $table->integer('user_id'); |
| 65 | 65 | $table->index(['role_id', 'user_id']); |
| 66 | 66 | $table->timestamps(); |
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | - Schema::create(config('admin.database.role_permissions_table'), function (Blueprint $table) { |
|
| 69 | + Schema::create(config('admin.database.role_permissions_table'), function(Blueprint $table) { |
|
| 70 | 70 | $table->integer('role_id'); |
| 71 | 71 | $table->integer('permission_id'); |
| 72 | 72 | $table->index(['role_id', 'permission_id']); |
| 73 | 73 | $table->timestamps(); |
| 74 | 74 | }); |
| 75 | 75 | |
| 76 | - Schema::create(config('admin.database.user_permissions_table'), function (Blueprint $table) { |
|
| 76 | + Schema::create(config('admin.database.user_permissions_table'), function(Blueprint $table) { |
|
| 77 | 77 | $table->integer('user_id'); |
| 78 | 78 | $table->integer('permission_id'); |
| 79 | 79 | $table->index(['user_id', 'permission_id']); |
| 80 | 80 | $table->timestamps(); |
| 81 | 81 | }); |
| 82 | 82 | |
| 83 | - Schema::create(config('admin.database.role_menu_table'), function (Blueprint $table) { |
|
| 83 | + Schema::create(config('admin.database.role_menu_table'), function(Blueprint $table) { |
|
| 84 | 84 | $table->integer('role_id'); |
| 85 | 85 | $table->integer('menu_id'); |
| 86 | 86 | $table->index(['role_id', 'menu_id']); |
| 87 | 87 | $table->timestamps(); |
| 88 | 88 | }); |
| 89 | 89 | |
| 90 | - Schema::create(config('admin.database.operation_log_table'), function (Blueprint $table) { |
|
| 90 | + Schema::create(config('admin.database.operation_log_table'), function(Blueprint $table) { |
|
| 91 | 91 | $table->increments('id'); |
| 92 | 92 | $table->integer('user_id'); |
| 93 | 93 | $table->string('path'); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | /** |
| 228 | 228 | * Field constructor. |
| 229 | 229 | * |
| 230 | - * @param $column |
|
| 230 | + * @param string $column |
|
| 231 | 231 | * @param array $arguments |
| 232 | 232 | */ |
| 233 | 233 | public function __construct($column, $arguments = []) |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | /** |
| 564 | 564 | * Set or get value of the field. |
| 565 | 565 | * |
| 566 | - * @param null $value |
|
| 566 | + * @param string $value |
|
| 567 | 567 | * |
| 568 | 568 | * @return mixed |
| 569 | 569 | */ |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | /** |
| 735 | 735 | * Add html attributes to elements. |
| 736 | 736 | * |
| 737 | - * @param array|string $attribute |
|
| 737 | + * @param string $attribute |
|
| 738 | 738 | * @param mixed $value |
| 739 | 739 | * |
| 740 | 740 | * @return $this |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | /** |
| 1021 | 1021 | * Get element class. |
| 1022 | 1022 | * |
| 1023 | - * @return array |
|
| 1023 | + * @return string |
|
| 1024 | 1024 | */ |
| 1025 | 1025 | protected function getGroupClass($default = false) |
| 1026 | 1026 | : string |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | /** |
| 1072 | - * @param array $labelClass |
|
| 1072 | + * @param string[] $labelClass |
|
| 1073 | 1073 | * |
| 1074 | 1074 | * @return self |
| 1075 | 1075 | */ |
@@ -1122,7 +1122,7 @@ discard block |
||
| 1122 | 1122 | /** |
| 1123 | 1123 | * Set view of current field. |
| 1124 | 1124 | * |
| 1125 | - * @return string |
|
| 1125 | + * @return Field |
|
| 1126 | 1126 | */ |
| 1127 | 1127 | public function setView($view) |
| 1128 | 1128 | { |
@@ -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__'])) { |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | $this->generateManifest(); |
| 46 | 46 | |
| 47 | 47 | $this->comment('JS and CSS are successfully minified:'); |
| 48 | - $this->line(' ' . Admin::$min['js']); |
|
| 49 | - $this->line(' ' . Admin::$min['css']); |
|
| 48 | + $this->line(' '.Admin::$min['js']); |
|
| 49 | + $this->line(' '.Admin::$min['css']); |
|
| 50 | 50 | |
| 51 | 51 | $this->line(''); |
| 52 | 52 | |
| 53 | 53 | $this->comment('Manifest successfully generated:'); |
| 54 | - $this->line(' ' . Admin::$manifest); |
|
| 54 | + $this->line(' '.Admin::$manifest); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | protected function clearMinifiedFiles() |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $this->comment('Following files are cleared:'); |
| 64 | 64 | |
| 65 | - $this->line(' ' . Admin::$min['js']); |
|
| 66 | - $this->line(' ' . Admin::$min['css']); |
|
| 67 | - $this->line(' ' . Admin::$manifest); |
|
| 65 | + $this->line(' '.Admin::$min['js']); |
|
| 66 | + $this->line(' '.Admin::$min['css']); |
|
| 67 | + $this->line(' '.Admin::$manifest); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | protected function minifyCSS() |
| 71 | 71 | { |
| 72 | 72 | $css = collect(array_merge(Admin::$css, Admin::baseCss())) |
| 73 | - ->unique()->map(function ($css) { |
|
| 73 | + ->unique()->map(function($css) { |
|
| 74 | 74 | |
| 75 | 75 | if (Str::contains($css, '?')) { |
| 76 | 76 | $css = substr($css, 0, strpos($css, '?')); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | protected function minifyJS() |
| 90 | 90 | { |
| 91 | 91 | $js = collect(array_merge(Admin::$js, Admin::baseJs())) |
| 92 | - ->unique()->map(function ($js) { |
|
| 92 | + ->unique()->map(function($js) { |
|
| 93 | 93 | if (Str::contains($js, '?')) { |
| 94 | 94 | $js = substr($js, 0, strpos($js, '?')); |
| 95 | 95 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | protected function generateManifest() |
| 108 | 108 | { |
| 109 | - $json = collect(Admin::$min)->flatMap(function ($value) { |
|
| 109 | + $json = collect(Admin::$min)->flatMap(function($value) { |
|
| 110 | 110 | |
| 111 | 111 | return [$value => sprintf('%s?id=%s', $value, md5(uniqid()))]; |
| 112 | 112 | |