| @@ -259,7 +259,7 @@ discard block | ||
| 259 | 259 | */ | 
| 260 | 260 | public function field($name) | 
| 261 | 261 |      { | 
| 262 | -        return $this->fields()->first(function (Field $field) use ($name) { | |
| 262 | +        return $this->fields()->first(function(Field $field) use ($name) { | |
| 263 | 263 | return $field->column() == $name; | 
| 264 | 264 | }); | 
| 265 | 265 | } | 
| @@ -502,7 +502,7 @@ discard block | ||
| 502 | 502 | $this->form->model()->getUpdatedAtColumn(), | 
| 503 | 503 | ]; | 
| 504 | 504 | |
| 505 | -        $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) { | |
| 505 | +        $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) { | |
| 506 | 506 | return in_array($field->column(), $reservedColumns); | 
| 507 | 507 | }); | 
| 508 | 508 | |
| @@ -528,7 +528,7 @@ discard block | ||
| 528 | 528 |      { | 
| 529 | 529 | $rules = []; | 
| 530 | 530 |          foreach ($this->fields() as $item) { | 
| 531 | -            if(!empty($item->getRules())){ | |
| 531 | +            if (!empty($item->getRules())) { | |
| 532 | 532 | $rules[$item->id] = $item->getRules(); | 
| 533 | 533 | } | 
| 534 | 534 | } | 
| @@ -544,7 +544,7 @@ discard block | ||
| 544 | 544 | public function getRuleMessages() | 
| 545 | 545 |      { | 
| 546 | 546 | $rules = []; | 
| 547 | -        foreach ($this->fields() as $item ) { | |
| 547 | +        foreach ($this->fields() as $item) { | |
| 548 | 548 |              foreach ($item->validationMessages as $key => $value) { | 
| 549 | 549 | $rules[$key] = $value; | 
| 550 | 550 | } | 
| @@ -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 | /** | 
| @@ -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 | 
| @@ -650,7 +650,7 @@ discard block | ||
| 650 | 650 | * Add html attributes to elements. | 
| 651 | 651 | * | 
| 652 | 652 | * @param array|string $attribute | 
| 653 | - * @param mixed $value | |
| 653 | + * @param boolean|string $value | |
| 654 | 654 | * | 
| 655 | 655 | * @return $this | 
| 656 | 656 | */ | 
| @@ -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.' . $relationColumn; | 
| @@ -374,7 +377,7 @@ discard block | ||
| 374 | 377 | /** | 
| 375 | 378 | * Get the grid paginator. | 
| 376 | 379 | * | 
| 377 | - * @return mixed | |
| 380 | + * @return Tools\Paginator | |
| 378 | 381 | */ | 
| 379 | 382 | public function paginator() | 
| 380 | 383 |      { | 
| @@ -750,7 +753,7 @@ discard block | ||
| 750 | 753 | * | 
| 751 | 754 | * @param Closure|null $closure | 
| 752 | 755 | * | 
| 753 | - * @return $this|Tools\Footer | |
| 756 | + * @return callable | |
| 754 | 757 | */ | 
| 755 | 758 | public function footer(Closure $closure = null) | 
| 756 | 759 |      { | 
| @@ -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,16 +286,16 @@ 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.' . $relationColumn; | |
| 291 | + $trans_key = 'validation.attributes.'.$relationColumn; | |
| 292 | 292 | $trans_key_low = strtolower($trans_key); | 
| 293 | 293 |           if (empty($label) && Lang::has($trans_key)) { | 
| 294 | 294 | $label = Lang::get($trans_key); | 
| 295 | 295 | } | 
| 296 | 296 |           if (empty($label) && Lang::has($trans_key_low)) { | 
| 297 | 297 | $label = Lang::get($trans_key_low); | 
| 298 | -        }else if (empty($label)) { | |
| 298 | +        } else if (empty($label)) { | |
| 299 | 299 | $label = ucfirst($relationColumn); | 
| 300 | 300 | } | 
| 301 | 301 | return $label; | 
| @@ -454,7 +454,7 @@ discard block | ||
| 454 | 454 | $callback = $this->actionsCallback; | 
| 455 | 455 |          $column = $this->addColumn('__actions__', trans('admin.action')); | 
| 456 | 456 | |
| 457 | -        $column->display(function ($value) use ($grid, $column, $callback) { | |
| 457 | +        $column->display(function($value) use ($grid, $column, $callback) { | |
| 458 | 458 | $actions = new Actions($value, $grid, $column, $this); | 
| 459 | 459 | |
| 460 | 460 | return $actions->display($callback); | 
| @@ -468,7 +468,7 @@ discard block | ||
| 468 | 468 | */ | 
| 469 | 469 | public function disableRowSelector() | 
| 470 | 470 |      { | 
| 471 | -        $this->tools(function ($tools) { | |
| 471 | +        $this->tools(function($tools) { | |
| 472 | 472 | /* @var Grid\Tools $tools */ | 
| 473 | 473 | $tools->disableBatchActions(); | 
| 474 | 474 | }); | 
| @@ -492,7 +492,7 @@ discard block | ||
| 492 | 492 | $column = new Column(Column::SELECT_COLUMN_NAME, ' '); | 
| 493 | 493 | $column->setGrid($this); | 
| 494 | 494 | |
| 495 | -        $column->display(function ($value) use ($grid, $column) { | |
| 495 | +        $column->display(function($value) use ($grid, $column) { | |
| 496 | 496 | $actions = new RowSelector($value, $grid, $column, $this); | 
| 497 | 497 | |
| 498 | 498 | return $actions->display(); | 
| @@ -519,7 +519,7 @@ discard block | ||
| 519 | 519 | |
| 520 | 520 | Column::setOriginalGridData($data); | 
| 521 | 521 | |
| 522 | -        $this->columns->map(function (Column $column) use (&$data) { | |
| 522 | +        $this->columns->map(function(Column $column) use (&$data) { | |
| 523 | 523 | $data = $column->fill($data); | 
| 524 | 524 | |
| 525 | 525 | $this->columnNames[] = $column->getName(); | 
| @@ -597,7 +597,7 @@ discard block | ||
| 597 | 597 | */ | 
| 598 | 598 | protected function buildRows(array $data) | 
| 599 | 599 |      { | 
| 600 | -        $this->rows = collect($data)->map(function ($model, $number) { | |
| 600 | +        $this->rows = collect($data)->map(function($model, $number) { | |
| 601 | 601 | return new Row($number, $model); | 
| 602 | 602 | }); | 
| 603 | 603 | |
| @@ -895,7 +895,7 @@ discard block | ||
| 895 | 895 | public function __call($method, $arguments) | 
| 896 | 896 |      { | 
| 897 | 897 | $label = isset($arguments[0]) ? $arguments[0] : null; | 
| 898 | - $label = $this->setLabel($label,$method); | |
| 898 | + $label = $this->setLabel($label, $method); | |
| 899 | 899 | |
| 900 | 900 |          if ($this->model()->eloquent() instanceof MongodbModel) { | 
| 901 | 901 | return $this->addColumn($method, $label); | 
| @@ -106,6 +106,10 @@ discard block | ||
| 106 | 106 |      { | 
| 107 | 107 | $this->setPresenter(new Text($this->label)); | 
| 108 | 108 | } | 
| 109 | + | |
| 110 | + /** | |
| 111 | + * @param string $label | |
| 112 | + */ | |
| 109 | 113 | public function setLabel($label) | 
| 110 | 114 |      { | 
| 111 | 115 | $trans_key = 'validation.attributes.' . $label; | 
| @@ -350,7 +354,7 @@ discard block | ||
| 350 | 354 | * | 
| 351 | 355 | * @param Presenter $presenter | 
| 352 | 356 | * | 
| 353 | - * @return mixed | |
| 357 | + * @return Presenter | |
| 354 | 358 | */ | 
| 355 | 359 | protected function setPresenter(Presenter $presenter) | 
| 356 | 360 |      { | 
| @@ -108,14 +108,14 @@ discard block | ||
| 108 | 108 | } | 
| 109 | 109 | public function setLabel($label) | 
| 110 | 110 |      { | 
| 111 | - $trans_key = 'validation.attributes.' . $label; | |
| 111 | + $trans_key = 'validation.attributes.'.$label; | |
| 112 | 112 | $trans_key_low = strtolower($trans_key); | 
| 113 | 113 |          if (Lang::has($trans_key)) { | 
| 114 | 114 | $label = Lang::get($trans_key); | 
| 115 | 115 | } | 
| 116 | 116 |          if (Lang::has($trans_key_low)) { | 
| 117 | 117 | $label = Lang::get($trans_key_low); | 
| 118 | -        }else { | |
| 118 | +        } else { | |
| 119 | 119 | $label = ucfirst($label); | 
| 120 | 120 | } | 
| 121 | 121 | return $label; | 
| @@ -442,7 +442,7 @@ discard block | ||
| 442 | 442 | |
| 443 | 443 |          list($relation, $args[0]) = explode('.', $this->column); | 
| 444 | 444 | |
| 445 | -        return ['whereHas' => [$relation, function ($relation) use ($args) { | |
| 445 | +        return ['whereHas' => [$relation, function($relation) use ($args) { | |
| 446 | 446 | call_user_func_array([$relation, $this->query], $args); | 
| 447 | 447 | }]]; | 
| 448 | 448 | } | 
| @@ -410,7 +410,7 @@ discard block | ||
| 410 | 410 | $grid = $this->grid; | 
| 411 | 411 | $column = $this; | 
| 412 | 412 | |
| 413 | -        $this->display(function ($value) use ($grid, $column, $class) { | |
| 413 | +        $this->display(function($value) use ($grid, $column, $class) { | |
| 414 | 414 | $definition = new $class($value, $grid, $column, $this); | 
| 415 | 415 | |
| 416 | 416 | return $definition->display(); | 
| @@ -427,7 +427,7 @@ discard block | ||
| 427 | 427 | protected function htmlEntityEncode($item) | 
| 428 | 428 |      { | 
| 429 | 429 |          if (is_array($item)) { | 
| 430 | -            array_walk_recursive($item, function (&$value) { | |
| 430 | +            array_walk_recursive($item, function(&$value) { | |
| 431 | 431 | $value = htmlentities($value); | 
| 432 | 432 | }); | 
| 433 | 433 |          } else { | 
| @@ -507,7 +507,7 @@ discard block | ||
| 507 | 507 | */ | 
| 508 | 508 | protected function callSupportDisplayer($abstract, $arguments) | 
| 509 | 509 |      { | 
| 510 | -        return $this->display(function ($value) use ($abstract, $arguments) { | |
| 510 | +        return $this->display(function($value) use ($abstract, $arguments) { | |
| 511 | 511 |              if (is_array($value) || $value instanceof Arrayable) { | 
| 512 | 512 | return call_user_func_array([collect($value), $abstract], $arguments); | 
| 513 | 513 | } | 
| @@ -531,7 +531,7 @@ discard block | ||
| 531 | 531 | protected function callBuiltinDisplayer($abstract, $arguments) | 
| 532 | 532 |      { | 
| 533 | 533 |          if ($abstract instanceof Closure) { | 
| 534 | -            return $this->display(function ($value) use ($abstract, $arguments) { | |
| 534 | +            return $this->display(function($value) use ($abstract, $arguments) { | |
| 535 | 535 | return $abstract->call($this, ...array_merge([$value], $arguments)); | 
| 536 | 536 | }); | 
| 537 | 537 | } | 
| @@ -540,7 +540,7 @@ discard block | ||
| 540 | 540 | $grid = $this->grid; | 
| 541 | 541 | $column = $this; | 
| 542 | 542 | |
| 543 | -            return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { | |
| 543 | +            return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { | |
| 544 | 544 | $displayer = new $abstract($value, $grid, $column, $this); | 
| 545 | 545 | |
| 546 | 546 | return call_user_func_array([$displayer, 'display'], $arguments); | 
| @@ -551,14 +551,14 @@ discard block | ||
| 551 | 551 | } | 
| 552 | 552 | public function setLabel($label) | 
| 553 | 553 |      { | 
| 554 | - $trans_key = 'validation.attributes.' . $label; | |
| 554 | + $trans_key = 'validation.attributes.'.$label; | |
| 555 | 555 | $trans_key_low = strtolower($trans_key); | 
| 556 | 556 |          if (Lang::has($trans_key)) { | 
| 557 | 557 | $label = Lang::get($trans_key); | 
| 558 | 558 | } | 
| 559 | 559 |          if (Lang::has($trans_key_low)) { | 
| 560 | 560 | $label = Lang::get($trans_key_low); | 
| 561 | -        }else { | |
| 561 | +        } else { | |
| 562 | 562 | $label = ucfirst($label); | 
| 563 | 563 | } | 
| 564 | 564 | return $label; | 
| @@ -223,7 +223,7 @@ discard block | ||
| 223 | 223 | |
| 224 | 224 | protected function editAction() | 
| 225 | 225 |      { | 
| 226 | -        $_edit =  trans('admin.edit'); | |
| 226 | +        $_edit = trans('admin.edit'); | |
| 227 | 227 | return <<<EOT | 
| 228 | 228 |  <a class="btn btn-xs btn-default" href="{$this->getResource()}/{$this->getKey()}/edit"> | 
| 229 | 229 | <i class="fa fa-edit"></i> $_edit | 
| @@ -235,7 +235,7 @@ discard block | ||
| 235 | 235 | protected function deleteAction() | 
| 236 | 236 |      { | 
| 237 | 237 | $this->___deleteAction(); | 
| 238 | -        $_delete =  trans('admin.delete'); | |
| 238 | +        $_delete = trans('admin.delete'); | |
| 239 | 239 | return <<<EOT | 
| 240 | 240 |  <a href="javascript:void(0);" data-id="{$this->getKey()}" class="grid-row-delete btn btn-xs btn-danger"> | 
| 241 | 241 | <i class="fa fa-trash"></i> $_delete | 
| @@ -47,7 +47,7 @@ discard block | ||
| 47 | 47 |      { | 
| 48 | 48 | $fields = $this->collectFields($content); | 
| 49 | 49 | |
| 50 | - $id = 'form-' . ($this->tabs->count() + 1); | |
| 50 | + $id = 'form-'.($this->tabs->count() + 1); | |
| 51 | 51 | //if define tab and row inside of tab ,you cant define row in form or simple field in tab | 
| 52 | 52 | $rows = $this->form->builder()->getRows(); | 
| 53 | 53 | $this->form->builder()->setRows([]); | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | public function getTabs() | 
| 85 | 85 |      { | 
| 86 | 86 | // If there is no active tab, then active the first. | 
| 87 | -        if ($this->tabs->filter(function ($tab) { | |
| 87 | +        if ($this->tabs->filter(function($tab) { | |
| 88 | 88 | return $tab['active']; | 
| 89 | 89 |          })->isEmpty()) { | 
| 90 | 90 | $first = $this->tabs->first(); | 
| @@ -26,6 +26,9 @@ discard block | ||
| 26 | 26 | return $this; | 
| 27 | 27 | } | 
| 28 | 28 | |
| 29 | + /** | |
| 30 | + * @param string $string | |
| 31 | + */ | |
| 29 | 32 | public function prepend($string) | 
| 30 | 33 |      { | 
| 31 | 34 |          if (is_null($this->prepend)) { | 
| @@ -35,6 +38,9 @@ discard block | ||
| 35 | 38 | return $this; | 
| 36 | 39 | } | 
| 37 | 40 | |
| 41 | + /** | |
| 42 | + * @param string $string | |
| 43 | + */ | |
| 38 | 44 | public function append($string) | 
| 39 | 45 |      { | 
| 40 | 46 |          if (is_null($this->append)) { | 
| @@ -51,6 +57,9 @@ discard block | ||
| 51 | 57 | } | 
| 52 | 58 | } | 
| 53 | 59 | |
| 60 | + /** | |
| 61 | + * @param string $attribute | |
| 62 | + */ | |
| 54 | 63 | protected function defaultAttribute($attribute, $value) | 
| 55 | 64 |      { | 
| 56 | 65 |          if (!array_key_exists($attribute, $this->attributes)) { | 
| @@ -11,7 +11,7 @@ discard block | ||
| 11 | 11 | public function prependIcon($icon, $class = "") | 
| 12 | 12 |      { | 
| 13 | 13 |          if (is_null($this->prepend)) { | 
| 14 | - $this->prepend = '<i class="fa fa-' . $icon . " " . $class . '"></i>'; | |
| 14 | + $this->prepend = '<i class="fa fa-'.$icon." ".$class.'"></i>'; | |
| 15 | 15 | } | 
| 16 | 16 | |
| 17 | 17 | return $this; | 
| @@ -20,7 +20,7 @@ discard block | ||
| 20 | 20 | public function appendIcon($icon, $class = "") | 
| 21 | 21 |      { | 
| 22 | 22 |          if (is_null($this->append)) { | 
| 23 | - $this->append = '<i class="fa fa-' . $icon . " " . $class . '"></i>'; | |
| 23 | + $this->append = '<i class="fa fa-'.$icon." ".$class.'"></i>'; | |
| 24 | 24 | } | 
| 25 | 25 | |
| 26 | 26 | return $this; | 
| @@ -328,9 +328,9 @@ discard block | ||
| 328 | 328 | $data = $this->model->with($this->getRelations()) | 
| 329 | 329 | ->findOrFail($id)->toArray(); | 
| 330 | 330 | |
| 331 | -        $this->builder->fields()->filter(function ($field) { | |
| 331 | +        $this->builder->fields()->filter(function($field) { | |
| 332 | 332 | return $field instanceof Field\File; | 
| 333 | -        })->each(function (File $file) use ($data) { | |
| 333 | +        })->each(function(File $file) use ($data) { | |
| 334 | 334 | $file->setOriginal($data); | 
| 335 | 335 | |
| 336 | 336 | $file->destroy(); | 
| @@ -355,7 +355,7 @@ discard block | ||
| 355 | 355 | return $response; | 
| 356 | 356 | } | 
| 357 | 357 | |
| 358 | -        DB::transaction(function () { | |
| 358 | +        DB::transaction(function() { | |
| 359 | 359 | $inserts = $this->prepareInsert($this->updates); | 
| 360 | 360 | |
| 361 | 361 |              foreach ($inserts as $column => $value) { | 
| @@ -559,7 +559,7 @@ discard block | ||
| 559 | 559 | return $response; | 
| 560 | 560 | } | 
| 561 | 561 | |
| 562 | -        DB::transaction(function () { | |
| 562 | +        DB::transaction(function() { | |
| 563 | 563 | $updates = $this->prepareUpdate($this->updates); | 
| 564 | 564 | |
| 565 | 565 |              foreach ($updates as $column => $value) { | 
| @@ -807,7 +807,7 @@ discard block | ||
| 807 | 807 | */ | 
| 808 | 808 | protected function invalidColumn($columns, $oneToOneRelation = false) | 
| 809 | 809 |      { | 
| 810 | -        foreach ((array)$columns as $column) { | |
| 810 | +        foreach ((array) $columns as $column) { | |
| 811 | 811 | if ((!$oneToOneRelation && Str::contains($column, '.')) || | 
| 812 | 812 | ($oneToOneRelation && !Str::contains($column, '.')) | 
| 813 | 813 |              ) { | 
| @@ -916,7 +916,7 @@ discard block | ||
| 916 | 916 | */ | 
| 917 | 917 | public function ignore($fields) | 
| 918 | 918 |      { | 
| 919 | - $this->ignored = array_merge($this->ignored, (array)$fields); | |
| 919 | + $this->ignored = array_merge($this->ignored, (array) $fields); | |
| 920 | 920 | |
| 921 | 921 | return $this; | 
| 922 | 922 | } | 
| @@ -956,7 +956,7 @@ discard block | ||
| 956 | 956 | protected function getFieldByColumn($column) | 
| 957 | 957 |      { | 
| 958 | 958 | return $this->builder->fields()->first( | 
| 959 | -            function (Field $field) use ($column) { | |
| 959 | +            function(Field $field) use ($column) { | |
| 960 | 960 |                  if (is_array($field->column())) { | 
| 961 | 961 | return in_array($column, $field->column()); | 
| 962 | 962 | } | 
| @@ -977,7 +977,7 @@ discard block | ||
| 977 | 977 | |
| 978 | 978 | $values = $this->model->toArray(); | 
| 979 | 979 | |
| 980 | -        $this->builder->fields()->each(function (Field $field) use ($values) { | |
| 980 | +        $this->builder->fields()->each(function(Field $field) use ($values) { | |
| 981 | 981 | $field->setOriginal($values); | 
| 982 | 982 | }); | 
| 983 | 983 | } | 
| @@ -999,7 +999,7 @@ discard block | ||
| 999 | 999 | |
| 1000 | 1000 | $data = $this->model->toArray(); | 
| 1001 | 1001 | |
| 1002 | -        $this->builder->fields()->each(function (Field $field) use ($data) { | |
| 1002 | +        $this->builder->fields()->each(function(Field $field) use ($data) { | |
| 1003 | 1003 | $field->fill($data); | 
| 1004 | 1004 | }); | 
| 1005 | 1005 | } | 
| @@ -1118,7 +1118,7 @@ discard block | ||
| 1118 | 1118 | */ | 
| 1119 | 1119 | public function setWidth($fieldWidth = 8, $labelWidth = 2) | 
| 1120 | 1120 |      { | 
| 1121 | -        $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { | |
| 1121 | +        $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { | |
| 1122 | 1122 | /* @var Field $field */ | 
| 1123 | 1123 | $field->setWidth($fieldWidth, $labelWidth); | 
| 1124 | 1124 | }); |