@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | "$this->viewPrefix.index", |
331 | 331 | "twill::$this->moduleName.index", |
332 | 332 | "twill::layouts.listing", |
333 | - ])->first(function ($view) { |
|
333 | + ])->first(function($view) { |
|
334 | 334 | return View::exists($view); |
335 | 335 | }); |
336 | 336 | |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | "$this->viewPrefix.form", |
422 | 422 | "twill::$this->moduleName.form", |
423 | 423 | "twill::layouts.form", |
424 | - ])->first(function ($view) { |
|
424 | + ])->first(function($view) { |
|
425 | 425 | return View::exists($view); |
426 | 426 | }); |
427 | 427 | |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | "$this->viewPrefix.form", |
538 | 538 | "twill::$this->moduleName.form", |
539 | 539 | "twill::layouts.form", |
540 | - ])->first(function ($view) { |
|
540 | + ])->first(function($view) { |
|
541 | 541 | return View::exists($view); |
542 | 542 | }); |
543 | 543 | |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | $query = $this->request->input('q'); |
785 | 785 | $tags = $this->repository->getTags($query); |
786 | 786 | |
787 | - return Response::json(['items' => $tags->map(function ($tag) { |
|
787 | + return Response::json(['items' => $tags->map(function($tag) { |
|
788 | 788 | return $tag->name; |
789 | 789 | })], 200); |
790 | 790 | } |
@@ -871,8 +871,8 @@ discard block |
||
871 | 871 | protected function getIndexTableData($items) |
872 | 872 | { |
873 | 873 | $translated = $this->moduleHas('translations'); |
874 | - return $items->map(function ($item) use ($translated) { |
|
875 | - $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function ($column) use ($item) { |
|
874 | + return $items->map(function($item) use ($translated) { |
|
875 | + $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function($column) use ($item) { |
|
876 | 876 | return $this->getItemColumnData($item, $column); |
877 | 877 | })->toArray(); |
878 | 878 | |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | 'feature', |
1130 | 1130 | 'bulkFeature', |
1131 | 1131 | 'bulkDelete', |
1132 | - ])->mapWithKeys(function ($endpoint) { |
|
1132 | + ])->mapWithKeys(function($endpoint) { |
|
1133 | 1133 | return [ |
1134 | 1134 | $endpoint . 'Url' => $this->getIndexOption($endpoint) ? moduleRoute( |
1135 | 1135 | $this->moduleName, $this->routePrefix, $endpoint, |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | */ |
1146 | 1146 | protected function getIndexOption($option) |
1147 | 1147 | { |
1148 | - return once(function () use ($option) { |
|
1148 | + return once(function() use ($option) { |
|
1149 | 1149 | $customOptionNamesMapping = [ |
1150 | 1150 | 'store' => 'create', |
1151 | 1151 | ]; |
@@ -1201,8 +1201,8 @@ discard block |
||
1201 | 1201 | { |
1202 | 1202 | $withImage = $this->moduleHas('medias'); |
1203 | 1203 | |
1204 | - return $items->map(function ($item) use ($withImage) { |
|
1205 | - $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function ($column) use ($item) { |
|
1204 | + return $items->map(function($item) use ($withImage) { |
|
1205 | + $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function($column) use ($item) { |
|
1206 | 1206 | return $this->getItemColumnData($item, $column); |
1207 | 1207 | })->toArray(); |
1208 | 1208 | |
@@ -1268,7 +1268,7 @@ discard block |
||
1268 | 1268 | $fieldSplitted = explode('|', $field); |
1269 | 1269 | if (count($fieldSplitted) > 1) { |
1270 | 1270 | $requestValue = $requestFilters[$key]; |
1271 | - Collection::make($fieldSplitted)->each(function ($scopeKey) use (&$scope, $requestValue) { |
|
1271 | + Collection::make($fieldSplitted)->each(function($scopeKey) use (&$scope, $requestValue) { |
|
1272 | 1272 | $scope[$scopeKey] = $requestValue; |
1273 | 1273 | }); |
1274 | 1274 | } else { |
@@ -1435,11 +1435,11 @@ discard block |
||
1435 | 1435 | */ |
1436 | 1436 | protected function validateFormRequest() |
1437 | 1437 | { |
1438 | - $unauthorizedFields = Collection::make($this->fieldsPermissions)->filter(function ($permission, $field) { |
|
1438 | + $unauthorizedFields = Collection::make($this->fieldsPermissions)->filter(function($permission, $field) { |
|
1439 | 1439 | return Auth::guard('twill_users')->user()->cannot($permission); |
1440 | 1440 | })->keys(); |
1441 | 1441 | |
1442 | - $unauthorizedFields->each(function ($field) { |
|
1442 | + $unauthorizedFields->each(function($field) { |
|
1443 | 1443 | $this->request->offsetUnset($field); |
1444 | 1444 | }); |
1445 | 1445 | |
@@ -1679,7 +1679,7 @@ discard block |
||
1679 | 1679 | */ |
1680 | 1680 | public function getRepeaterList() |
1681 | 1681 | { |
1682 | - return app(BlockCollection::class)->getRepeaterList()->mapWithKeys(function ($repeater) { |
|
1682 | + return app(BlockCollection::class)->getRepeaterList()->mapWithKeys(function($repeater) { |
|
1683 | 1683 | return [$repeater['name'] => $repeater]; |
1684 | 1684 | }); |
1685 | 1685 | } |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | { |
66 | 66 | return collect( |
67 | 67 | config('twill.block_editor.directories.source.icons') |
68 | - )->reduce(function (Collection $keep, $path) { |
|
68 | + )->reduce(function(Collection $keep, $path) { |
|
69 | 69 | if (!$this->files->exists($path)) { |
70 | 70 | $this->displayError("Directory not found: {$path}"); |
71 | 71 | |
72 | 72 | return $keep; |
73 | 73 | } |
74 | 74 | |
75 | - $files = collect($this->files->files($path))->map(function ( |
|
75 | + $files = collect($this->files->files($path))->map(function( |
|
76 | 76 | SplFileInfo $file |
77 | 77 | ) { |
78 | 78 | return [ |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function handle() |
94 | 94 | { |
95 | - $icons = $this->getIconList()->filter(function ($icon) { |
|
95 | + $icons = $this->getIconList()->filter(function($icon) { |
|
96 | 96 | return $this->isAllowed($icon); |
97 | 97 | }); |
98 | 98 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function byKey($key, $section = null) |
36 | 36 | { |
37 | - return $this->model->when($section, function ($query) use ($section) { |
|
37 | + return $this->model->when($section, function($query) use ($section) { |
|
38 | 38 | $query->where('section', $section); |
39 | 39 | })->where('key', $key)->exists() ? $this->model->where('key', $key)->with('translations')->first()->value : null; |
40 | 40 | } |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function getFormFields($section = null) |
47 | 47 | { |
48 | - $settings = $this->model->when($section, function ($query) use ($section) { |
|
48 | + $settings = $this->model->when($section, function($query) use ($section) { |
|
49 | 49 | $query->where('section', $section); |
50 | 50 | })->with('translations', 'medias')->get(); |
51 | 51 | |
52 | 52 | |
53 | 53 | if (config('twill.media_library.translated_form_fields', false)) { |
54 | - $medias = $settings->reduce(function ($carry, $setting) { |
|
54 | + $medias = $settings->reduce(function($carry, $setting) { |
|
55 | 55 | foreach (getLocales() as $locale) { |
56 | 56 | if (!empty(parent::getFormFields($setting)['medias'][$locale]) && !empty(parent::getFormFields($setting)['medias'][$locale][$setting->key])) |
57 | 57 | { |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | return $carry; |
62 | 62 | }); |
63 | 63 | } else { |
64 | - $medias = $settings->mapWithKeys(function ($setting) { |
|
64 | + $medias = $settings->mapWithKeys(function($setting) { |
|
65 | 65 | return [$setting->key => parent::getFormFields($setting)['medias'][$setting->key] ?? null]; |
66 | 66 | })->filter()->toArray(); |
67 | 67 | } |
68 | 68 | |
69 | - return $settings->mapWithKeys(function ($setting) { |
|
69 | + return $settings->mapWithKeys(function($setting) { |
|
70 | 70 | $settingValue = []; |
71 | 71 | |
72 | 72 | foreach ($setting->translations as $translation) { |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | |
118 | 118 | if (config('twill.media_library.translated_form_fields', false)) { |
119 | 119 | foreach (getLocales() as $locale) { |
120 | - $medias["{$role}[{$locale}]"] = Collection::make($settingsFields['medias'][$role][$locale])->map(function ($media) { |
|
120 | + $medias["{$role}[{$locale}]"] = Collection::make($settingsFields['medias'][$role][$locale])->map(function($media) { |
|
121 | 121 | return json_decode($media, true); |
122 | 122 | })->filter()->toArray(); |
123 | 123 | } |
124 | 124 | } else { |
125 | - $medias = [ |
|
126 | - $role => Collection::make($settingsFields['medias'][$role])->mapWithKeys(function ($media, $key) { |
|
125 | + $medias = [ |
|
126 | + $role => Collection::make($settingsFields['medias'][$role])->mapWithKeys(function($media, $key) { |
|
127 | 127 | return json_decode($media, true); |
128 | 128 | })->values()->filter()->toArray(), |
129 | 129 | ]; |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | { |
21 | 21 | $icons = collect( |
22 | 22 | config('twill.block_editor.directories.source.icons') |
23 | - )->reduce(function (Collection $keep, $path) { |
|
23 | + )->reduce(function(Collection $keep, $path) { |
|
24 | 24 | if (!$this->files->exists($path)) { |
25 | 25 | return $keep; |
26 | 26 | } |
27 | 27 | |
28 | - $files = collect($this->files->files($path))->map(function ( |
|
28 | + $files = collect($this->files->files($path))->map(function( |
|
29 | 29 | SplFileInfo $file |
30 | 30 | ) { |
31 | 31 | if (in_array($file->getFilename(), config('twill.internal_icons'))) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | abort(404); |
55 | 55 | } |
56 | 56 | |
57 | - return response()->stream(function () use ($file) { |
|
57 | + return response()->stream(function() use ($file) { |
|
58 | 58 | echo $this->files->get($file); |
59 | 59 | }, 200, ["Content-Type" => "image/svg+xml"]); |
60 | 60 |