@@ -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)); |
@@ -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 | */ |
@@ -906,7 +906,7 @@ |
||
| 906 | 906 | */ |
| 907 | 907 | public function popover($title = null, $content) |
| 908 | 908 | { |
| 909 | - return $this->attribute([ |
|
| 909 | + return $this->attribute([ |
|
| 910 | 910 | 'data-popover-title' => $title, |
| 911 | 911 | 'data-popover' => $content, |
| 912 | 912 | ]); |
@@ -235,10 +235,10 @@ |
||
| 235 | 235 | 'middleware' => config('admin.route.middleware'), |
| 236 | 236 | ]; |
| 237 | 237 | |
| 238 | - Route::group($attributes, function ($router) { |
|
| 238 | + Route::group($attributes, function($router) { |
|
| 239 | 239 | |
| 240 | 240 | /* @var \Illuminate\Routing\Router $router */ |
| 241 | - $router->group([], function ($router) { |
|
| 241 | + $router->group([], function($router) { |
|
| 242 | 242 | |
| 243 | 243 | /* @var \Illuminate\Routing\Router $router */ |
| 244 | 244 | $router->resource('auth/users', 'UserController'); |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | @if(Session::has('error')) |
| 2 | - <?php $error = Session::get('error');?> |
|
| 2 | + <?php $error = Session::get('error'); ?> |
|
| 3 | 3 | <div class="alert alert-danger alert-dismissable"> |
| 4 | 4 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
| 5 | 5 | <h4><i class="icon fa fa-ban"></i>{{ array_get($error->get('title'), 0) }}</h4> |
| 6 | 6 | <p>{!! array_get($error->get('message'), 0) !!}</p> |
| 7 | 7 | </div> |
| 8 | 8 | @elseif (Session::has('errors')) |
| 9 | - <?php $errors = Session::get('errors');?> |
|
| 9 | + <?php $errors = Session::get('errors'); ?> |
|
| 10 | 10 | @if ($errors->hasBag('error')) |
| 11 | 11 | <div class="alert alert-danger alert-dismissable"> |
| 12 | 12 | |
@@ -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; |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | { |
| 87 | 87 | parent::boot(); |
| 88 | 88 | |
| 89 | - static::deleting(function ($model) { |
|
| 89 | + static::deleting(function($model) { |
|
| 90 | 90 | $model->administrators()->detach(); |
| 91 | 91 | |
| 92 | 92 | $model->permissions()->detach(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $method = $this->http_method; |
| 68 | 68 | |
| 69 | - $matches = array_map(function ($path) use ($method) { |
|
| 69 | + $matches = array_map(function($path) use ($method) { |
|
| 70 | 70 | $path = trim(config('admin.route.prefix'), '/').$path; |
| 71 | 71 | |
| 72 | 72 | if (Str::contains($path, ':')) { |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | return false; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $method = collect($match['method'])->filter()->map(function ($method) { |
|
| 103 | + $method = collect($match['method'])->filter()->map(function($method) { |
|
| 104 | 104 | return strtoupper($method); |
| 105 | 105 | }); |
| 106 | 106 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | { |
| 141 | 141 | parent::boot(); |
| 142 | 142 | |
| 143 | - static::deleting(function ($model) { |
|
| 143 | + static::deleting(function($model) { |
|
| 144 | 144 | $model->roles()->detach(); |
| 145 | 145 | }); |
| 146 | 146 | } |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | { |
| 77 | 77 | parent::boot(); |
| 78 | 78 | |
| 79 | - static::deleting(function ($model) { |
|
| 79 | + static::deleting(function($model) { |
|
| 80 | 80 | $model->roles()->detach(); |
| 81 | 81 | }); |
| 82 | 82 | } |
@@ -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 | { |
@@ -290,14 +290,14 @@ |
||
| 290 | 290 | { |
| 291 | 291 | $trans_key = 'validation.attributes.' . $relationColumn; |
| 292 | 292 | $trans_key_low = strtolower($trans_key); |
| 293 | - if (empty($label) && Lang::has($trans_key)) { |
|
| 294 | - $label = Lang::get($trans_key); |
|
| 295 | - } |
|
| 296 | - if (empty($label) && Lang::has($trans_key_low)) { |
|
| 293 | + if (empty($label) && Lang::has($trans_key)) { |
|
| 294 | + $label = Lang::get($trans_key); |
|
| 295 | + } |
|
| 296 | + if (empty($label) && Lang::has($trans_key_low)) { |
|
| 297 | 297 | $label = Lang::get($trans_key_low); |
| 298 | 298 | }else if (empty($label)) { |
| 299 | - $label = ucfirst($relationColumn); |
|
| 300 | - } |
|
| 299 | + $label = ucfirst($relationColumn); |
|
| 300 | + } |
|
| 301 | 301 | return $label; |
| 302 | 302 | } |
| 303 | 303 | |
@@ -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); |
@@ -295,7 +295,7 @@ |
||
| 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; |