@@ -162,7 +162,7 @@ |
||
162 | 162 | */ |
163 | 163 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
164 | 164 | { |
165 | - collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
165 | + collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) { |
|
166 | 166 | /* @var Field $field */ |
167 | 167 | $field->setWidth($fieldWidth, $labelWidth); |
168 | 168 | }); |
@@ -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(); |
@@ -78,7 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | static::treeBoot(); |
80 | 80 | |
81 | - static::deleting(function ($model) { |
|
81 | + static::deleting(function($model) { |
|
82 | 82 | $model->roles()->detach(); |
83 | 83 | }); |
84 | 84 | } |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | |
226 | 226 | $this->setSort(); |
227 | 227 | |
228 | - $this->queries->reject(function ($query) { |
|
228 | + $this->queries->reject(function($query) { |
|
229 | 229 | return $query['method'] == 'paginate'; |
230 | - })->each(function ($query) { |
|
230 | + })->each(function($query) { |
|
231 | 231 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
232 | 232 | }); |
233 | 233 | |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | $this->setSort(); |
275 | 275 | $this->setPaginate(); |
276 | 276 | |
277 | - $this->queries->unique()->each(function ($query) { |
|
277 | + $this->queries->unique()->each(function($query) { |
|
278 | 278 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
279 | 279 | }); |
280 | 280 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | { |
319 | 319 | $paginate = $this->findQueryByMethod('paginate'); |
320 | 320 | |
321 | - $this->queries = $this->queries->reject(function ($query) { |
|
321 | + $this->queries = $this->queries->reject(function($query) { |
|
322 | 322 | return $query['method'] == 'paginate'; |
323 | 323 | }); |
324 | 324 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | protected function findQueryByMethod($method) |
374 | 374 | { |
375 | - return $this->queries->first(function ($query) use ($method) { |
|
375 | + return $this->queries->first(function($query) use ($method) { |
|
376 | 376 | return $query['method'] == $method; |
377 | 377 | }); |
378 | 378 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | { |
417 | 417 | list($relationName, $relationColumn) = explode('.', $column); |
418 | 418 | |
419 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
419 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
420 | 420 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
421 | 421 | })) { |
422 | 422 | $relation = $this->model->$relationName(); |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function resetOrderBy() |
447 | 447 | { |
448 | - $this->queries = $this->queries->reject(function ($query) { |
|
448 | + $this->queries = $this->queries->reject(function($query) { |
|
449 | 449 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
450 | 450 | }); |
451 | 451 | } |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | $data = $this->model->with($this->getRelations()) |
306 | 306 | ->findOrFail($id)->toArray(); |
307 | 307 | |
308 | - $this->builder->fields()->filter(function ($field) { |
|
308 | + $this->builder->fields()->filter(function($field) { |
|
309 | 309 | return $field instanceof Field\File; |
310 | - })->each(function (File $file) use ($data) { |
|
310 | + })->each(function(File $file) use ($data) { |
|
311 | 311 | $file->setOriginal($data); |
312 | 312 | |
313 | 313 | $file->destroy(); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | return $response; |
333 | 333 | } |
334 | 334 | |
335 | - DB::transaction(function () { |
|
335 | + DB::transaction(function() { |
|
336 | 336 | $inserts = $this->prepareInsert($this->updates); |
337 | 337 | |
338 | 338 | foreach ($inserts as $column => $value) { |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | return $response; |
534 | 534 | } |
535 | 535 | |
536 | - DB::transaction(function () { |
|
536 | + DB::transaction(function() { |
|
537 | 537 | $updates = $this->prepareUpdate($this->updates); |
538 | 538 | |
539 | 539 | foreach ($updates as $column => $value) { |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | protected function getFieldByColumn($column) |
926 | 926 | { |
927 | 927 | return $this->builder->fields()->first( |
928 | - function (Field $field) use ($column) { |
|
928 | + function(Field $field) use ($column) { |
|
929 | 929 | if (is_array($field->column())) { |
930 | 930 | return in_array($column, $field->column()); |
931 | 931 | } |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | |
947 | 947 | $values = $this->model->toArray(); |
948 | 948 | |
949 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
949 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
950 | 950 | $field->setOriginal($values); |
951 | 951 | }); |
952 | 952 | } |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | |
969 | 969 | $data = $this->model->toArray(); |
970 | 970 | |
971 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
971 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
972 | 972 | if (!in_array($field->column(), $this->ignored)) { |
973 | 973 | $field->fill($data); |
974 | 974 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | */ |
1090 | 1090 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
1091 | 1091 | { |
1092 | - $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
1092 | + $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
1093 | 1093 | /* @var Field $field */ |
1094 | 1094 | $field->setWidth($fieldWidth, $labelWidth); |
1095 | 1095 | }); |