@@ -20,20 +20,20 @@ |
||
20 | 20 | public static function environment() |
21 | 21 | { |
22 | 22 | $envs = [ |
23 | - ['name' => 'PHP version', 'value' => 'PHP/'.PHP_VERSION], |
|
24 | - ['name' => 'Laravel version', 'value' => app()->version()], |
|
25 | - ['name' => 'CGI', 'value' => php_sapi_name()], |
|
26 | - ['name' => 'Uname', 'value' => php_uname()], |
|
27 | - ['name' => 'Server', 'value' => array_get($_SERVER, 'SERVER_SOFTWARE')], |
|
23 | + ['name' => 'PHP version', 'value' => 'PHP/'.PHP_VERSION], |
|
24 | + ['name' => 'Laravel version', 'value' => app()->version()], |
|
25 | + ['name' => 'CGI', 'value' => php_sapi_name()], |
|
26 | + ['name' => 'Uname', 'value' => php_uname()], |
|
27 | + ['name' => 'Server', 'value' => array_get($_SERVER, 'SERVER_SOFTWARE')], |
|
28 | 28 | |
29 | - ['name' => 'Cache driver', 'value' => config('cache.default')], |
|
30 | - ['name' => 'Session driver', 'value' => config('session.driver')], |
|
31 | - ['name' => 'Queue driver', 'value' => config('queue.default')], |
|
29 | + ['name' => 'Cache driver', 'value' => config('cache.default')], |
|
30 | + ['name' => 'Session driver', 'value' => config('session.driver')], |
|
31 | + ['name' => 'Queue driver', 'value' => config('queue.default')], |
|
32 | 32 | |
33 | - ['name' => 'Timezone', 'value' => config('app.timezone')], |
|
34 | - ['name' => 'Locale', 'value' => config('app.locale')], |
|
35 | - ['name' => 'Env', 'value' => config('app.env')], |
|
36 | - ['name' => 'URL', 'value' => config('app.url')], |
|
33 | + ['name' => 'Timezone', 'value' => config('app.timezone')], |
|
34 | + ['name' => 'Locale', 'value' => config('app.locale')], |
|
35 | + ['name' => 'Env', 'value' => config('app.env')], |
|
36 | + ['name' => 'URL', 'value' => config('app.url')], |
|
37 | 37 | ]; |
38 | 38 | |
39 | 39 | return view('admin::dashboard.environment', compact('envs')); |
@@ -168,7 +168,7 @@ |
||
168 | 168 | * |
169 | 169 | * @param string $target |
170 | 170 | * |
171 | - * @return mixed |
|
171 | + * @return string |
|
172 | 172 | */ |
173 | 173 | protected function getClass($target) : string |
174 | 174 | { |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | 'Content-Disposition' => "attachment; filename=\"$filename\"", |
22 | 22 | ]; |
23 | 23 | |
24 | - response()->stream(function () { |
|
24 | + response()->stream(function() { |
|
25 | 25 | $handle = fopen('php://output', 'w'); |
26 | 26 | |
27 | 27 | $titles = []; |
28 | 28 | |
29 | - $this->chunk(function ($records) use ($handle, &$titles) { |
|
29 | + $this->chunk(function($records) use ($handle, &$titles) { |
|
30 | 30 | if (empty($titles)) { |
31 | 31 | $titles = $this->getHeaderRowFromRecords($records); |
32 | 32 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function getHeaderRowFromRecords(Collection $records): array |
55 | 55 | { |
56 | 56 | $titles = collect(array_dot($records->first()->toArray()))->keys()->map( |
57 | - function ($key) { |
|
57 | + function($key) { |
|
58 | 58 | $key = str_replace('.', ' ', $key); |
59 | 59 | |
60 | 60 | return Str::ucfirst($key); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | return ''; |
71 | 71 | } |
72 | 72 | |
73 | - return $this->elements[$part]->map(function ($element) { |
|
73 | + return $this->elements[$part]->map(function($element) { |
|
74 | 74 | if ($element instanceof Htmlable) { |
75 | 75 | return $element->toHtml(); |
76 | 76 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | /** |
408 | 408 | * Get or set rules. |
409 | 409 | * |
410 | - * @param null $rules |
|
410 | + * @param string $rules |
|
411 | 411 | * @param array $messages |
412 | 412 | * |
413 | 413 | * @return $this |
@@ -649,8 +649,8 @@ discard block |
||
649 | 649 | /** |
650 | 650 | * Add html attributes to elements. |
651 | 651 | * |
652 | - * @param array|string $attribute |
|
653 | - * @param mixed $value |
|
652 | + * @param string $attribute |
|
653 | + * @param boolean|string $value |
|
654 | 654 | * |
655 | 655 | * @return $this |
656 | 656 | */ |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | $column = is_array($this->column) ? current($this->column) : $this->column; |
246 | 246 | |
247 | - $trans_key = 'validation.attributes.' . strtolower($column); |
|
247 | + $trans_key = 'validation.attributes.'.strtolower($column); |
|
248 | 248 | if (isset($arguments[0])) { |
249 | 249 | $label = $arguments[0]; |
250 | 250 | } else if (Lang::has($trans_key)) { |
@@ -619,9 +619,9 @@ discard block |
||
619 | 619 | if (!array_key_exists($column, $input)) { |
620 | 620 | continue; |
621 | 621 | } |
622 | - $input[$column . $key] = array_get($input, $column); |
|
623 | - $rules[$column . $key] = $fieldRules; |
|
624 | - $attributes[$column . $key] = $this->label . "[$column]"; |
|
622 | + $input[$column.$key] = array_get($input, $column); |
|
623 | + $rules[$column.$key] = $fieldRules; |
|
624 | + $attributes[$column.$key] = $this->label."[$column]"; |
|
625 | 625 | } |
626 | 626 | } |
627 | 627 | |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | if (is_array($attribute)) { |
660 | 660 | $this->attributes = array_merge($this->attributes, $attribute); |
661 | 661 | } else { |
662 | - $this->attributes[$attribute] = (string)$value; |
|
662 | + $this->attributes[$attribute] = (string) $value; |
|
663 | 663 | } |
664 | 664 | |
665 | 665 | return $this; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | */ |
697 | 697 | public function getPlaceholder() |
698 | 698 | { |
699 | - return $this->placeholder ?: trans('admin.input') . ' ' . $this->label; |
|
699 | + return $this->placeholder ?: trans('admin.input').' '.$this->label; |
|
700 | 700 | } |
701 | 701 | |
702 | 702 | /** |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | $html = []; |
722 | 722 | |
723 | 723 | foreach ($this->attributes as $name => $value) { |
724 | - $html[] = $name . '="' . e($value) . '"'; |
|
724 | + $html[] = $name.'="'.e($value).'"'; |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | return implode(' ', $html); |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | */ |
767 | 767 | public function setElementClass($class) |
768 | 768 | { |
769 | - $this->elementClass = (array)$class; |
|
769 | + $this->elementClass = (array) $class; |
|
770 | 770 | |
771 | 771 | return $this; |
772 | 772 | } |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | if (!$this->elementClass) { |
782 | 782 | $name = $this->elementName ?: $this->formatName($this->column); |
783 | 783 | |
784 | - $this->elementClass = (array)str_replace([ |
|
784 | + $this->elementClass = (array) str_replace([ |
|
785 | 785 | '[', |
786 | 786 | ']' |
787 | 787 | ], '_', $name); |
@@ -825,13 +825,13 @@ discard block |
||
825 | 825 | $classes = []; |
826 | 826 | |
827 | 827 | foreach ($elementClass as $index => $class) { |
828 | - $classes[$index] = '.' . (is_array($class) ? implode('.', $class) : $class); |
|
828 | + $classes[$index] = '.'.(is_array($class) ? implode('.', $class) : $class); |
|
829 | 829 | } |
830 | 830 | |
831 | 831 | return $classes; |
832 | 832 | } |
833 | 833 | |
834 | - return '.' . implode('.', $elementClass); |
|
834 | + return '.'.implode('.', $elementClass); |
|
835 | 835 | } |
836 | 836 | |
837 | 837 | /** |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | public function addElementClass($class) |
845 | 845 | { |
846 | 846 | if (is_array($class) || is_string($class)) { |
847 | - $this->elementClass = array_merge($this->elementClass, (array)$class); |
|
847 | + $this->elementClass = array_merge($this->elementClass, (array) $class); |
|
848 | 848 | |
849 | 849 | $this->elementClass = array_unique($this->elementClass); |
850 | 850 | } |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | $delClass = []; |
865 | 865 | |
866 | 866 | if (is_string($class) || is_array($class)) { |
867 | - $delClass = (array)$class; |
|
867 | + $delClass = (array) $class; |
|
868 | 868 | } |
869 | 869 | |
870 | 870 | foreach ($delClass as $del) { |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | |
912 | 912 | $class = explode('\\', get_called_class()); |
913 | 913 | |
914 | - return 'admin::form.' . strtolower(end($class)); |
|
914 | + return 'admin::form.'.strtolower(end($class)); |
|
915 | 915 | } |
916 | 916 | |
917 | 917 | /** |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * Get or set option for grid. |
230 | 230 | * |
231 | 231 | * @param string $key |
232 | - * @param mixed $value |
|
232 | + * @param boolean $value |
|
233 | 233 | * |
234 | 234 | * @return $this|mixed |
235 | 235 | */ |
@@ -286,6 +286,9 @@ discard block |
||
286 | 286 | return $column; |
287 | 287 | } |
288 | 288 | |
289 | + /** |
|
290 | + * @return string |
|
291 | + */ |
|
289 | 292 | public function setLabel($label , $relationColumn) |
290 | 293 | { |
291 | 294 | $trans_key = 'validation.attributes.' . strtolower($relationColumn); |
@@ -371,7 +374,7 @@ discard block |
||
371 | 374 | /** |
372 | 375 | * Get the grid paginator. |
373 | 376 | * |
374 | - * @return mixed |
|
377 | + * @return Tools\Paginator |
|
375 | 378 | */ |
376 | 379 | public function paginator() |
377 | 380 | { |
@@ -735,7 +738,7 @@ discard block |
||
735 | 738 | * |
736 | 739 | * @param Closure|null $closure |
737 | 740 | * |
738 | - * @return $this|Tools\Footer |
|
741 | + * @return callable |
|
739 | 742 | */ |
740 | 743 | public function footer(Closure $closure = null) |
741 | 744 | { |
@@ -290,11 +290,11 @@ |
||
290 | 290 | { |
291 | 291 | $trans_key = 'validation.attributes.' . strtolower($relationColumn); |
292 | 292 | |
293 | - if (empty($label) && Lang::has($trans_key)) { |
|
293 | + if (empty($label) && Lang::has($trans_key)) { |
|
294 | 294 | $label = Lang::get($trans_key); |
295 | 295 | }else if (empty($label)) { |
296 | - $label = ucfirst($relationColumn); |
|
297 | - } |
|
296 | + $label = ucfirst($relationColumn); |
|
297 | + } |
|
298 | 298 | return $label; |
299 | 299 | } |
300 | 300 |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | $relation = $this->model()->eloquent()->$relationName(); |
273 | 273 | |
274 | - $label = $this->setLabel($label,$relationColumn); |
|
274 | + $label = $this->setLabel($label, $relationColumn); |
|
275 | 275 | // $label = empty($label) ? ucfirst($relationColumn) : $label; |
276 | 276 | $name = snake_case($relationName).'.'.$relationColumn; |
277 | 277 | } |
@@ -286,13 +286,13 @@ discard block |
||
286 | 286 | return $column; |
287 | 287 | } |
288 | 288 | |
289 | - public function setLabel($label , $relationColumn) |
|
289 | + public function setLabel($label, $relationColumn) |
|
290 | 290 | { |
291 | - $trans_key = 'validation.attributes.' . strtolower($relationColumn); |
|
291 | + $trans_key = 'validation.attributes.'.strtolower($relationColumn); |
|
292 | 292 | |
293 | 293 | if (empty($label) && Lang::has($trans_key)) { |
294 | 294 | $label = Lang::get($trans_key); |
295 | - }else if (empty($label)) { |
|
295 | + } else if (empty($label)) { |
|
296 | 296 | $label = ucfirst($relationColumn); |
297 | 297 | } |
298 | 298 | return $label; |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $callback = $this->actionsCallback; |
452 | 452 | $column = $this->addColumn('__actions__', trans('admin.action')); |
453 | 453 | |
454 | - $column->display(function ($value) use ($grid, $column, $callback) { |
|
454 | + $column->display(function($value) use ($grid, $column, $callback) { |
|
455 | 455 | $actions = new Actions($value, $grid, $column, $this); |
456 | 456 | |
457 | 457 | return $actions->display($callback); |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | */ |
466 | 466 | public function disableRowSelector() |
467 | 467 | { |
468 | - $this->tools(function ($tools) { |
|
468 | + $this->tools(function($tools) { |
|
469 | 469 | /* @var Grid\Tools $tools */ |
470 | 470 | $tools->disableBatchActions(); |
471 | 471 | }); |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $column = new Column(Column::SELECT_COLUMN_NAME, ' '); |
490 | 490 | $column->setGrid($this); |
491 | 491 | |
492 | - $column->display(function ($value) use ($grid, $column) { |
|
492 | + $column->display(function($value) use ($grid, $column) { |
|
493 | 493 | $actions = new RowSelector($value, $grid, $column, $this); |
494 | 494 | |
495 | 495 | return $actions->display(); |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | |
517 | 517 | Column::setOriginalGridData($data); |
518 | 518 | |
519 | - $this->columns->map(function (Column $column) use (&$data) { |
|
519 | + $this->columns->map(function(Column $column) use (&$data) { |
|
520 | 520 | $data = $column->fill($data); |
521 | 521 | |
522 | 522 | $this->columnNames[] = $column->getName(); |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | */ |
595 | 595 | protected function buildRows(array $data) |
596 | 596 | { |
597 | - $this->rows = collect($data)->map(function ($model, $number) { |
|
597 | + $this->rows = collect($data)->map(function($model, $number) { |
|
598 | 598 | return new Row($number, $model); |
599 | 599 | }); |
600 | 600 | |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | { |
882 | 882 | // $label = isset($arguments[0]) ? $arguments[0] : ucfirst($method); |
883 | 883 | $label = isset($arguments[0]) ? $arguments[0] : null; |
884 | - $label = $this->setLabel($label,$method); |
|
884 | + $label = $this->setLabel($label, $method); |
|
885 | 885 | |
886 | 886 | if ($this->model()->eloquent() instanceof MongodbModel) { |
887 | 887 | return $this->addColumn($method, $label); |
@@ -292,7 +292,7 @@ |
||
292 | 292 | |
293 | 293 | if (empty($label) && Lang::has($trans_key)) { |
294 | 294 | $label = Lang::get($trans_key); |
295 | - }else if (empty($label)) { |
|
295 | + } else if (empty($label)) { |
|
296 | 296 | $label = ucfirst($relationColumn); |
297 | 297 | } |
298 | 298 | return $label; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $this->value = explode(',', $this->value); |
27 | 27 | } |
28 | 28 | |
29 | - $this->value = array_filter((array)$this->value); |
|
29 | + $this->value = array_filter((array) $this->value); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | if (is_callable($options)) { |
71 | 71 | $this->options = $options; |
72 | 72 | } else { |
73 | - $this->options = (array)$options; |
|
73 | + $this->options = (array) $options; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $this; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | protected function loadOptionsFromRemote($url, $parameters = [], $options = []) |
146 | 146 | { |
147 | 147 | $ajaxOptions = [ |
148 | - 'url' => $url . '?' . http_build_query($parameters), |
|
148 | + 'url' => $url.'?'.http_build_query($parameters), |
|
149 | 149 | ]; |
150 | 150 | |
151 | 151 | $ajaxOptions = json_encode(array_merge($ajaxOptions, $options)); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | protected function collectFields(\Closure $content) |
65 | 65 | { |
66 | 66 | call_user_func($content, $this->form); |
67 | - $all = $this->form->builder()->removeReservedFields()->fields(); |
|
67 | + $all = $this->form->builder()->removeReservedFields()->fields(); |
|
68 | 68 | |
69 | 69 | $fields = $all->slice($this->offset); |
70 | 70 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function getTabs() |
82 | 82 | { |
83 | 83 | // If there is no active tab, then active the first. |
84 | - if ($this->tabs->filter(function ($tab) { |
|
84 | + if ($this->tabs->filter(function($tab) { |
|
85 | 85 | return $tab['active']; |
86 | 86 | })->isEmpty()) { |
87 | 87 | $first = $this->tabs->first(); |