@@ -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 | } |
@@ -155,7 +155,7 @@ |
||
155 | 155 | { |
156 | 156 | parent::boot(); |
157 | 157 | |
158 | - static::deleting(function ($model) { |
|
158 | + static::deleting(function($model) { |
|
159 | 159 | $model->roles()->detach(); |
160 | 160 | |
161 | 161 | $model->permissions()->detach(); |
@@ -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 |
@@ -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 | } |
@@ -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); |
@@ -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(); |