@@ -45,7 +45,7 @@ |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * @return mixed |
|
| 48 | + * @return string |
|
| 49 | 49 | */ |
| 50 | 50 | protected function getModelClass() |
| 51 | 51 | { |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | * |
| 282 | 282 | * @param string $column |
| 283 | 283 | * |
| 284 | - * @return mixed|string |
|
| 284 | + * @return string |
|
| 285 | 285 | */ |
| 286 | 286 | protected function formatColumn($column = '') |
| 287 | 287 | { |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | /** |
| 577 | - * @param string|array|Closure $input |
|
| 577 | + * @param callable|null $input |
|
| 578 | 578 | * @param string|array $original |
| 579 | 579 | * |
| 580 | 580 | * @return array|Closure |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | /** |
| 786 | 786 | * Set or get value of the field. |
| 787 | 787 | * |
| 788 | - * @param null $value |
|
| 788 | + * @param string $value |
|
| 789 | 789 | * |
| 790 | 790 | * @return mixed |
| 791 | 791 | */ |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | /** |
| 957 | 957 | * Add html attributes to elements. |
| 958 | 958 | * |
| 959 | - * @param array|string $attribute |
|
| 959 | + * @param string $attribute |
|
| 960 | 960 | * @param mixed $value |
| 961 | 961 | * |
| 962 | 962 | * @return $this |
@@ -1334,7 +1334,7 @@ discard block |
||
| 1334 | 1334 | } |
| 1335 | 1335 | |
| 1336 | 1336 | /** |
| 1337 | - * @param array $labelClass |
|
| 1337 | + * @param string[] $labelClass |
|
| 1338 | 1338 | * |
| 1339 | 1339 | * @return self |
| 1340 | 1340 | */ |
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | * |
| 1390 | 1390 | * @param string $view |
| 1391 | 1391 | * |
| 1392 | - * @return string |
|
| 1392 | + * @return Field |
|
| 1393 | 1393 | */ |
| 1394 | 1394 | public function setView($view): self |
| 1395 | 1395 | { |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | /** |
| 129 | 129 | * Build panel tools. |
| 130 | 130 | * |
| 131 | - * @param $callable |
|
| 131 | + * @param \Closure $callable |
|
| 132 | 132 | */ |
| 133 | 133 | public function tools($callable) |
| 134 | 134 | { |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | /** |
| 139 | 139 | * Fill fields to panel. |
| 140 | 140 | * |
| 141 | - * @param []Field $fields |
|
| 141 | + * @param Collection $fields |
|
| 142 | 142 | * |
| 143 | 143 | * @return $this |
| 144 | 144 | */ |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | $grid->column('created_at', trans('admin.created_at')); |
| 35 | 35 | $grid->column('updated_at', trans('admin.updated_at')); |
| 36 | 36 | |
| 37 | - $grid->actions(function (Grid\Displayers\Actions $actions) { |
|
| 37 | + $grid->actions(function(Grid\Displayers\Actions $actions) { |
|
| 38 | 38 | if ($actions->getKey() == 1) { |
| 39 | 39 | $actions->disableDelete(); |
| 40 | 40 | } |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | - $grid->tools(function (Grid\Tools $tools) { |
|
| 44 | - $tools->batch(function (Grid\Tools\BatchActions $actions) { |
|
| 43 | + $grid->tools(function(Grid\Tools $tools) { |
|
| 44 | + $tools->batch(function(Grid\Tools\BatchActions $actions) { |
|
| 45 | 45 | $actions->disableDelete(); |
| 46 | 46 | }); |
| 47 | 47 | }); |
@@ -65,15 +65,15 @@ discard block |
||
| 65 | 65 | $show->field('id', 'ID'); |
| 66 | 66 | $show->field('username', trans('admin.username')); |
| 67 | 67 | $show->field('name', trans('admin.name')); |
| 68 | - $show->field('roles', trans('admin.roles'))->as(function ($roles) { |
|
| 68 | + $show->field('roles', trans('admin.roles'))->as(function($roles) { |
|
| 69 | 69 | return $roles->pluck('name'); |
| 70 | 70 | })->label(); |
| 71 | - $show->field('permissions', trans('admin.permissions'))->as(function ($permission) { |
|
| 71 | + $show->field('permissions', trans('admin.permissions'))->as(function($permission) { |
|
| 72 | 72 | return $permission->pluck('name'); |
| 73 | 73 | })->label(); |
| 74 | 74 | $show->field('created_at', trans('admin.created_at')); |
| 75 | 75 | $show->field('updated_at', trans('admin.updated_at')); |
| 76 | - $show->panel()->tools(function ($tools) use ($id) { |
|
| 76 | + $show->panel()->tools(function($tools) use ($id) { |
|
| 77 | 77 | if ($id == 1) { |
| 78 | 78 | $tools->disableDelete(); |
| 79 | 79 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $form->image('avatar', trans('admin.avatar')); |
| 108 | 108 | $form->password('password', trans('admin.password'))->rules('required|confirmed'); |
| 109 | 109 | $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required') |
| 110 | - ->default(function ($form) { |
|
| 110 | + ->default(function($form) { |
|
| 111 | 111 | return $form->model()->password; |
| 112 | 112 | }); |
| 113 | 113 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $form->display('created_at', trans('admin.created_at')); |
| 120 | 120 | $form->display('updated_at', trans('admin.updated_at')); |
| 121 | 121 | |
| 122 | - $form->saving(function (Form $form) { |
|
| 122 | + $form->saving(function(Form $form) { |
|
| 123 | 123 | if ($form->password && $form->model()->password != $form->password) { |
| 124 | 124 | $form->password = bcrypt($form->password); |
| 125 | 125 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | /** |
| 154 | 154 | * Overwrite properties for field and relation. |
| 155 | 155 | * |
| 156 | - * @return Bool |
|
| 156 | + * @return Show |
|
| 157 | 157 | */ |
| 158 | 158 | protected function overWrite() |
| 159 | 159 | { |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | * @param string $method |
| 397 | 397 | * @param array $arguments |
| 398 | 398 | * |
| 399 | - * @return bool|mixed |
|
| 399 | + * @return Field |
|
| 400 | 400 | */ |
| 401 | 401 | public function __call($method, $arguments = []) |
| 402 | 402 | { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | protected function overWrite() |
| 159 | 159 | { |
| 160 | - $this->overWrite= true; |
|
| 160 | + $this->overWrite = true; |
|
| 161 | 161 | |
| 162 | 162 | return $this; |
| 163 | 163 | } |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $this->overwriteExistingField($name); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - return tap($field, function ($field) { |
|
| 246 | + return tap($field, function($field) { |
|
| 247 | 247 | $this->fields->push($field); |
| 248 | 248 | }); |
| 249 | 249 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | $this->overwriteExistingRelation($name); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - return tap($relation, function ($relation) { |
|
| 270 | + return tap($relation, function($relation) { |
|
| 271 | 271 | $this->relations->push($relation); |
| 272 | 272 | }); |
| 273 | 273 | } |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | $this->fields = $this->fields->filter( |
| 287 | - function (Field $field) use ($name) { |
|
| 287 | + function(Field $field) use ($name) { |
|
| 288 | 288 | return $field->getName() != $name; |
| 289 | 289 | } |
| 290 | 290 | ); |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | $this->relations = $this->relations->filter( |
| 305 | - function (Relation $relation) use ($name) { |
|
| 305 | + function(Relation $relation) use ($name) { |
|
| 306 | 306 | return $relation->getName() != $name; |
| 307 | 307 | } |
| 308 | 308 | ); |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | */ |
| 360 | 360 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
| 361 | 361 | { |
| 362 | - collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
| 362 | + collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) { |
|
| 363 | 363 | $field->each->setWidth($fieldWidth, $labelWidth); |
| 364 | 364 | }); |
| 365 | 365 | |