@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | // initialize action classes only at first execution. |
14 | 14 | if (is_array($items)) { |
15 | - $items = array_map(function ($handler) { |
|
15 | + $items = array_map(function($handler) { |
|
16 | 16 | return new $handler(); |
17 | 17 | }, $items); |
18 | 18 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function find($name) |
31 | 31 | { |
32 | - return $this->first(function ($action) use ($name) { |
|
32 | + return $this->first(function($action) use ($name) { |
|
33 | 33 | return class_basename($action) === studly_case($name); |
34 | 34 | }); |
35 | 35 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function authorized(User $user, Model $model = null) |
46 | 46 | { |
47 | - return $this->filter(function ($action) use ($user, $model) { |
|
47 | + return $this->filter(function($action) use ($user, $model) { |
|
48 | 48 | // authorize action only if action allows it. |
49 | 49 | if (method_exists($action, 'authorize')) { |
50 | 50 | return $action->authorize($user, $model); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | protected function scaffoldRules() |
21 | 21 | { |
22 | - return array_build(options_fetch(), function ($key, $option) { |
|
22 | + return array_build(options_fetch(), function($key, $option) { |
|
23 | 23 | return [$option->key, 'required']; |
24 | 24 | }); |
25 | 25 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $elements = $elements->merge($dates); |
85 | 85 | } else { |
86 | 86 | // add timestamps group |
87 | - $elements->group('dates', function (Group $group) use ($dates) { |
|
87 | + $elements->group('dates', function(Group $group) use ($dates) { |
|
88 | 88 | $group->merge($dates); |
89 | 89 | |
90 | 90 | return $group; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | foreach ($lines as $line) { |
26 | 26 | if (false !== stripos($line, $flag)) { |
27 | - $props = array_filter(explode(' ', $line), function ($prop) { |
|
27 | + $props = array_filter(explode(' ', $line), function($prop) { |
|
28 | 28 | return '' !== trim($prop) && '*' !== $prop; |
29 | 29 | }); |
30 | 30 |
@@ -91,7 +91,7 @@ |
||
91 | 91 | $rules[] = 'foreign'; |
92 | 92 | } |
93 | 93 | |
94 | - return array_map(function ($rule) use ($column, $eloquent) { |
|
94 | + return array_map(function($rule) use ($column, $eloquent) { |
|
95 | 95 | $method = 'make'.ucfirst($rule).'Rule'; |
96 | 96 | |
97 | 97 | return call_user_func_array([$this, $method], [$column, $eloquent]); |
@@ -158,7 +158,7 @@ |
||
158 | 158 | protected function buildId($id) |
159 | 159 | { |
160 | 160 | $parts = explode('.', $id); |
161 | - $parts = array_map(function ($part) { |
|
161 | + $parts = array_map(function($part) { |
|
162 | 162 | return str_slug($part, '_'); |
163 | 163 | }, $parts); |
164 | 164 | $id = implode('.', $parts); |
@@ -38,9 +38,9 @@ |
||
38 | 38 | return array_map( |
39 | 39 | 'intval', |
40 | 40 | \DB::table($object->getTable()) |
41 | - ->where($this->getQualifiedForeignKeyName($object), $orig->getKey()) |
|
42 | - ->pluck($this->getQualifiedRelatedKeyName($object)) |
|
43 | - ->toArray() |
|
41 | + ->where($this->getQualifiedForeignKeyName($object), $orig->getKey()) |
|
42 | + ->pluck($this->getQualifiedRelatedKeyName($object)) |
|
43 | + ->toArray() |
|
44 | 44 | ); |
45 | 45 | } |
46 | 46 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | $inputs = array_build( |
30 | 30 | \localizer\locales(), |
31 | - function ($key, $locale) use ($repository, $current, &$cycle, $translations) { |
|
31 | + function($key, $locale) use ($repository, $current, &$cycle, $translations) { |
|
32 | 32 | $element = $this->selfClone($locale, $repository); |
33 | 33 | |
34 | 34 | if ($translations->readonly($locale)) { |
@@ -134,8 +134,8 @@ |
||
134 | 134 | ])->render(); |
135 | 135 | |
136 | 136 | return $pdf->loadHTML($html) |
137 | - ->setPaper('a4', 'landscape') |
|
138 | - ->download(app('scaffold.module')->url().'.pdf'); |
|
137 | + ->setPaper('a4', 'landscape') |
|
138 | + ->download(app('scaffold.module')->url().'.pdf'); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | return $query |
156 | - ->when($query->getModel() instanceof Translatable, function ($query) { |
|
156 | + ->when($query->getModel() instanceof Translatable, function($query) { |
|
157 | 157 | $query->translated(); |
158 | 158 | }) |
159 | 159 | // leave select after joining with translations |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | protected function toScalar($object): array |
170 | 170 | { |
171 | - return array_filter($object->toArray(), function ($item) { |
|
171 | + return array_filter($object->toArray(), function($item) { |
|
172 | 172 | return is_scalar($item); |
173 | 173 | }); |
174 | 174 | } |
@@ -260,13 +260,13 @@ discard block |
||
260 | 260 | return collect($model->getFillable()) |
261 | 261 | ->prepend('id') |
262 | 262 | ->diff($model->getHidden()) |
263 | - ->map(function ($column) use ($model) { |
|
263 | + ->map(function($column) use ($model) { |
|
264 | 264 | return "{$model->getTable()}.{$column}"; |
265 | 265 | }) |
266 | - ->when($model instanceof Translatable, function (Collection $collection) use ($model) { |
|
266 | + ->when($model instanceof Translatable, function(Collection $collection) use ($model) { |
|
267 | 267 | return $collection->merge( |
268 | 268 | collect($model->getTranslatedAttributes()) |
269 | - ->map(function ($column) use ($model) { |
|
269 | + ->map(function($column) use ($model) { |
|
270 | 270 | return "tt.{$column}"; |
271 | 271 | }) |
272 | 272 | ); |