@@ -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 | /** |
@@ -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 | } |
@@ -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(); |
@@ -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 | } |