@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $featuredSources = $this->getFeaturedSources($request, $featuredSection, $filters['search'] ?? ''); |
44 | 44 | |
45 | - $contentTypes = Collection::make($featuredSources)->map(function ($source, $sourceKey) { |
|
45 | + $contentTypes = Collection::make($featuredSources)->map(function($source, $sourceKey) { |
|
46 | 46 | return [ |
47 | 47 | 'label' => $source['name'], |
48 | 48 | 'value' => $sourceKey, |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | return [ |
56 | 56 | 'source' => [ |
57 | - 'content_type' => Arr::first($contentTypes, function ($contentTypeItem) use ($request) { |
|
57 | + 'content_type' => Arr::first($contentTypes, function($contentTypeItem) use ($request) { |
|
58 | 58 | return $contentTypeItem['value'] == $request->get('content_type'); |
59 | 59 | }), |
60 | 60 | 'items' => $source['items'], |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | private function getFeaturedItemsByBucket($featuredSection, $featuredSectionKey) |
101 | 101 | { |
102 | 102 | $bucketRouteConfig = $this->config->get('twill.bucketsRoutes') ?? [$featuredSectionKey => 'featured']; |
103 | - return Collection::make($featuredSection['buckets'])->map(function ($bucket, $bucketKey) use ($featuredSectionKey, $bucketRouteConfig) { |
|
103 | + return Collection::make($featuredSection['buckets'])->map(function($bucket, $bucketKey) use ($featuredSectionKey, $bucketRouteConfig) { |
|
104 | 104 | $routePrefix = $bucketRouteConfig[$featuredSectionKey]; |
105 | 105 | return [ |
106 | 106 | 'id' => $bucketKey, |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'acceptedSources' => Collection::make($bucket['bucketables'])->pluck('module'), |
110 | 110 | 'withToggleFeatured' => $bucket['with_starred_items'] ?? false, |
111 | 111 | 'toggleFeaturedLabels' => $bucket['starred_items_labels'] ?? [], |
112 | - 'children' => Feature::where('bucket_key', $bucketKey)->with('featured')->get()->map(function ($feature) use ($bucket) { |
|
112 | + 'children' => Feature::where('bucket_key', $bucketKey)->with('featured')->get()->map(function($feature) use ($bucket) { |
|
113 | 113 | if (($item = $feature->featured) != null) { |
114 | 114 | $forModuleRepository = collect($bucket['bucketables'])->where('module', $feature->featured_type)->first()['repository'] ?? null; |
115 | 115 | $repository = $this->getRepository($feature->featured_type, $forModuleRepository); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | 'thumbnail' => $item->defaultCmsImage(['w' => 100, 'h' => 100]), |
129 | 129 | ] : []); |
130 | 130 | } |
131 | - })->reject(function ($item) { |
|
131 | + })->reject(function($item) { |
|
132 | 132 | return is_null($item); |
133 | 133 | })->values()->toArray(), |
134 | 134 | ]; |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | $fetchedModules = []; |
147 | 147 | $featuredSources = []; |
148 | 148 | |
149 | - Collection::make($featuredSection['buckets'])->map(function ($bucket, $bucketKey) use (&$fetchedModules, $search, $request) { |
|
150 | - return Collection::make($bucket['bucketables'])->mapWithKeys(function ($bucketable) use (&$fetchedModules, $search, $request) { |
|
149 | + Collection::make($featuredSection['buckets'])->map(function($bucket, $bucketKey) use (&$fetchedModules, $search, $request) { |
|
150 | + return Collection::make($bucket['bucketables'])->mapWithKeys(function($bucketable) use (&$fetchedModules, $search, $request) { |
|
151 | 151 | |
152 | 152 | $module = $bucketable['module']; |
153 | 153 | $repository = $this->getRepository($module, $bucketable['repository'] ?? null); |
@@ -176,12 +176,12 @@ discard block |
||
176 | 176 | 'withImage' => $withImage, |
177 | 177 | ]]; |
178 | 178 | }); |
179 | - })->each(function ($bucketables, $bucket) use (&$featuredSources) { |
|
180 | - $bucketables->each(function ($bucketableData, $bucketable) use (&$featuredSources) { |
|
179 | + })->each(function($bucketables, $bucket) use (&$featuredSources) { |
|
180 | + $bucketables->each(function($bucketableData, $bucketable) use (&$featuredSources) { |
|
181 | 181 | $featuredSources[$bucketable]['name'] = $bucketableData['name']; |
182 | 182 | $featuredSources[$bucketable]['maxPage'] = $bucketableData['items']->lastPage(); |
183 | 183 | $featuredSources[$bucketable]['offset'] = $bucketableData['items']->perPage(); |
184 | - $featuredSources[$bucketable]['items'] = $bucketableData['items']->map(function ($item) use ($bucketableData, $bucketable) { |
|
184 | + $featuredSources[$bucketable]['items'] = $bucketableData['items']->map(function($item) use ($bucketableData, $bucketable) { |
|
185 | 185 | return [ |
186 | 186 | 'id' => $item->id, |
187 | 187 | 'name' => $item->titleInBucket ?? $item->title, |
@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function save(Request $request, DB $db) |
212 | 212 | { |
213 | - $db->transaction(function () use ($request) { |
|
214 | - Collection::make($request->get('buckets'))->each(function ($bucketables, $bucketKey) { |
|
213 | + $db->transaction(function() use ($request) { |
|
214 | + Collection::make($request->get('buckets'))->each(function($bucketables, $bucketKey) { |
|
215 | 215 | Feature::where('bucket_key', $bucketKey)->delete(); |
216 | 216 | foreach (($bucketables ?? []) as $position => $bucketable) { |
217 | 217 | Feature::create([ |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | if (Schema::hasTable(config('twill.related_table', 'twill_related'))) { |
46 | 46 | $relatedItems = Collection::make(); |
47 | 47 | |
48 | - Collection::make($fields['browsers'])->each(function ($items, $browserName) use (&$relatedItems) { |
|
49 | - Collection::make($items)->each(function ($item) use ($browserName, &$relatedItems) { |
|
48 | + Collection::make($fields['browsers'])->each(function($items, $browserName) use (&$relatedItems) { |
|
49 | + Collection::make($items)->each(function($item) use ($browserName, &$relatedItems) { |
|
50 | 50 | try { |
51 | 51 | $repository = $this->getModelRepository($item['endpointType'] ?? $browserName); |
52 | 52 | $relatedItems->push((object) [ |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | if (Schema::hasTable(config('twill.related_table', 'twill_related'))) { |
76 | 76 | if (isset($fields['browsers'])) { |
77 | - Collection::make($fields['browsers'])->each(function ($items, $browserName) use ($object) { |
|
77 | + Collection::make($fields['browsers'])->each(function($items, $browserName) use ($object) { |
|
78 | 78 | $object->saveRelated($items, $browserName); |
79 | 79 | }); |
80 | 80 | } |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | { |
103 | 103 | $blocksFromConfig = $this->config->get('twill.block_editor.' . ($repeater ? 'repeaters' : 'blocks')); |
104 | 104 | |
105 | - $block['type'] = Collection::make($blocksFromConfig)->search(function ($blockConfig) use ($block) { |
|
105 | + $block['type'] = Collection::make($blocksFromConfig)->search(function($blockConfig) use ($block) { |
|
106 | 106 | return $blockConfig['component'] === $block['type']; |
107 | 107 | }); |
108 | 108 | |
109 | 109 | $block['content'] = empty($block['content']) ? new \stdClass : (object) $block['content']; |
110 | 110 | |
111 | 111 | if ($block['browsers']) { |
112 | - $browsers = Collection::make($block['browsers'])->map(function ($items) { |
|
112 | + $browsers = Collection::make($block['browsers'])->map(function($items) { |
|
113 | 113 | return Collection::make($items)->pluck('id'); |
114 | 114 | })->toArray(); |
115 | 115 |
@@ -16,23 +16,23 @@ |
||
16 | 16 | */ |
17 | 17 | public function boot() |
18 | 18 | { |
19 | - Validator::extend('absolute_or_relative_url', function ($attribute, $value, $parameters, $validator) { |
|
19 | + Validator::extend('absolute_or_relative_url', function($attribute, $value, $parameters, $validator) { |
|
20 | 20 | return Str::startsWith($value, '/') || Validator::make([$attribute => $value], [$attribute => 'url'])->passes(); |
21 | 21 | }, 'The :attribute should be a valid url (absolute or relative)'); |
22 | 22 | |
23 | - Validator::extend('relative_or_secure_url', function ($attribute, $value, $parameters) { |
|
23 | + Validator::extend('relative_or_secure_url', function($attribute, $value, $parameters) { |
|
24 | 24 | return Str::startsWith($value, '/') || filter_var($value, FILTER_VALIDATE_URL) !== false && Str::startsWith($value, 'https'); |
25 | 25 | }, 'The :attribute should be a valid url (relative or https)'); |
26 | 26 | |
27 | - Validator::extend('web_color', function ($attribute, $value, $parameters, $validator) { |
|
27 | + Validator::extend('web_color', function($attribute, $value, $parameters, $validator) { |
|
28 | 28 | return preg_match('/^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i', $value); |
29 | 29 | }); |
30 | 30 | |
31 | - Validator::extend('phone_number', function ($attribute, $value, $parameters) { |
|
31 | + Validator::extend('phone_number', function($attribute, $value, $parameters) { |
|
32 | 32 | return preg_match("/^[+]?[0-9\-\ ]*$/", $value); |
33 | 33 | }); |
34 | 34 | |
35 | - Validator::extend('validBlocks', function ($attribute, $value, $parameters, $validator) { |
|
35 | + Validator::extend('validBlocks', function($attribute, $value, $parameters, $validator) { |
|
36 | 36 | $blockMessages = []; |
37 | 37 | |
38 | 38 | foreach ($value as $block) { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | { |
12 | 12 | if (!app()->environment('local', 'development')) { |
13 | 13 | try { |
14 | - $manifest = Cache::rememberForever('rev-manifest', function () { |
|
14 | + $manifest = Cache::rememberForever('rev-manifest', function() { |
|
15 | 15 | return json_decode(file_get_contents(config('twill.frontend.rev_manifest_path')), true); |
16 | 16 | }); |
17 | 17 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | try { |
56 | - $manifest = Cache::rememberForever('twill-manifest', function () { |
|
56 | + $manifest = Cache::rememberForever('twill-manifest', function() { |
|
57 | 57 | return json_decode(file_get_contents( |
58 | 58 | public_path(config('twill.public_directory', 'twill')) |
59 | 59 | . '/' |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | if (config('twill.enabled.media-library')) { |
127 | - $this->app->singleton('imageService', function () { |
|
127 | + $this->app->singleton('imageService', function() { |
|
128 | 128 | return $this->app->make(config('twill.media_library.image_service')); |
129 | 129 | }); |
130 | 130 | } |
131 | 131 | |
132 | 132 | if (config('twill.enabled.file-library')) { |
133 | - $this->app->singleton('fileService', function () { |
|
133 | + $this->app->singleton('fileService', function() { |
|
134 | 134 | return $this->app->make(config('twill.file_library.file_service')); |
135 | 135 | }); |
136 | 136 | } |
@@ -307,20 +307,20 @@ discard block |
||
307 | 307 | { |
308 | 308 | $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler(); |
309 | 309 | |
310 | - $blade->directive('dd', function ($param) { |
|
310 | + $blade->directive('dd', function($param) { |
|
311 | 311 | return "<?php dd({$param}); ?>"; |
312 | 312 | }); |
313 | 313 | |
314 | - $blade->directive('dumpData', function ($data) { |
|
314 | + $blade->directive('dumpData', function($data) { |
|
315 | 315 | return sprintf("<?php (new Symfony\Component\VarDumper\VarDumper)->dump(%s); exit; ?>", |
316 | 316 | null != $data ? $data : "get_defined_vars()"); |
317 | 317 | }); |
318 | 318 | |
319 | - $blade->directive('formField', function ($expression) { |
|
319 | + $blade->directive('formField', function($expression) { |
|
320 | 320 | return $this->includeView('partials.form._', $expression); |
321 | 321 | }); |
322 | 322 | |
323 | - $blade->directive('partialView', function ($expression) { |
|
323 | + $blade->directive('partialView', function($expression) { |
|
324 | 324 | |
325 | 325 | $expressionAsArray = str_getcsv($expression, ',', '\''); |
326 | 326 | |
@@ -356,13 +356,13 @@ discard block |
||
356 | 356 | ?>"; |
357 | 357 | }); |
358 | 358 | |
359 | - $blade->directive('pushonce', function ($expression) { |
|
359 | + $blade->directive('pushonce', function($expression) { |
|
360 | 360 | list($pushName, $pushSub) = explode(':', trim(substr($expression, 1, -1))); |
361 | 361 | $key = '__pushonce_' . $pushName . '_' . str_replace('-', '_', $pushSub); |
362 | 362 | return "<?php if(! isset(\$__env->{$key})): \$__env->{$key} = 1; \$__env->startPush('{$pushName}'); ?>"; |
363 | 363 | }); |
364 | 364 | |
365 | - $blade->directive('endpushonce', function () { |
|
365 | + $blade->directive('endpushonce', function() { |
|
366 | 366 | return '<?php $__env->stopPush(); endif; ?>'; |
367 | 367 | }); |
368 | 368 | |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | View::composer('twill::partials.navigation.*', ActiveNavigation::class); |
396 | 396 | |
397 | - View::composer(['admin.*', 'templates.*', 'twill::*'], function ($view) { |
|
397 | + View::composer(['admin.*', 'templates.*', 'twill::*'], function($view) { |
|
398 | 398 | $with = array_merge([ |
399 | 399 | 'renderForBlocks' => false, |
400 | 400 | 'renderForModal' => false, |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | { |
109 | 109 | $modules = Collection::make($this->config->get('twill.dashboard.modules')); |
110 | 110 | |
111 | - return $modules->filter(function ($module) { |
|
111 | + return $modules->filter(function($module) { |
|
112 | 112 | return ($module['search'] ?? false); |
113 | - })->map(function ($module) use ($request) { |
|
113 | + })->map(function($module) use ($request) { |
|
114 | 114 | $repository = $this->getRepository($module['name'], $module['repository'] ?? null); |
115 | 115 | |
116 | 116 | $found = $repository->cmsSearch($request->get('search'), $module['search_fields'] ?? ['title'])->take(10); |
117 | 117 | |
118 | - return $found->map(function ($item) use ($module) { |
|
118 | + return $found->map(function($item) use ($module) { |
|
119 | 119 | try { |
120 | 120 | $author = $item->revisions()->latest()->first()->user->name ?? 'Admin'; |
121 | 121 | } catch (\Exception $e) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | private function getAllActivities() |
144 | 144 | { |
145 | - return Activity::take(20)->latest()->get()->map(function ($activity) { |
|
145 | + return Activity::take(20)->latest()->get()->map(function($activity) { |
|
146 | 146 | return $this->formatActivity($activity); |
147 | 147 | })->filter()->values(); |
148 | 148 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | private function getLoggedInUserActivities() |
154 | 154 | { |
155 | - return Activity::where('causer_id', $this->authFactory->guard('twill_users')->user()->id)->take(20)->latest()->get()->map(function ($activity) { |
|
155 | + return Activity::where('causer_id', $this->authFactory->guard('twill_users')->user()->id)->take(20)->latest()->get()->map(function($activity) { |
|
156 | 156 | return $this->formatActivity($activity); |
157 | 157 | })->filter()->values(); |
158 | 158 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | return []; |
206 | 206 | } |
207 | 207 | |
208 | - $statsByDate = Collection::make($response['rows'] ?? [])->map(function (array $dateRow) { |
|
208 | + $statsByDate = Collection::make($response['rows'] ?? [])->map(function(array $dateRow) { |
|
209 | 209 | return [ |
210 | 210 | 'date' => $dateRow[0], |
211 | 211 | 'users' => (int) $dateRow[1], |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | 'yesterday', |
221 | 221 | 'week', |
222 | 222 | 'month', |
223 | - ])->mapWithKeys(function ($period) use ($statsByDate) { |
|
223 | + ])->mapWithKeys(function($period) use ($statsByDate) { |
|
224 | 224 | $stats = $this->getPeriodStats($period, $statsByDate); |
225 | 225 | return [ |
226 | 226 | $period => [ |
@@ -257,10 +257,10 @@ discard block |
||
257 | 257 | 'stats' => $stats = $statsByDate->first(), |
258 | 258 | 'moreUsers' => $stats['users'] > $statsByDate->get(1)['users'], |
259 | 259 | 'morePageViews' => $stats['pageViews'] > $statsByDate->get(1)['pageViews'], |
260 | - 'usersData' => $statsByDate->take(7)->map(function ($stat) { |
|
260 | + 'usersData' => $statsByDate->take(7)->map(function($stat) { |
|
261 | 261 | return $stat['users']; |
262 | 262 | }), |
263 | - 'pageViewsData' => $statsByDate->take(7)->map(function ($stat) { |
|
263 | + 'pageViewsData' => $statsByDate->take(7)->map(function($stat) { |
|
264 | 264 | return $stat['pageViews']; |
265 | 265 | }), |
266 | 266 | ]; |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | 'stats' => $stats = $statsByDate->get(1), |
270 | 270 | 'moreUsers' => $stats['users'] > $statsByDate->get(2)['users'], |
271 | 271 | 'morePageViews' => $stats['pageViews'] > $statsByDate->get(2)['pageViews'], |
272 | - 'usersData' => $statsByDate->slice(1)->take(7)->map(function ($stat) { |
|
272 | + 'usersData' => $statsByDate->slice(1)->take(7)->map(function($stat) { |
|
273 | 273 | return $stat['users']; |
274 | 274 | }), |
275 | - 'pageViewsData' => $statsByDate->slice(1)->take(7)->map(function ($stat) { |
|
275 | + 'pageViewsData' => $statsByDate->slice(1)->take(7)->map(function($stat) { |
|
276 | 276 | return $stat['pageViews']; |
277 | 277 | }), |
278 | 278 | ]; |
@@ -295,10 +295,10 @@ discard block |
||
295 | 295 | 'stats' => $stats, |
296 | 296 | 'moreUsers' => $stats['users'] > $compareStats['users'], |
297 | 297 | 'morePageViews' => $stats['pageViews'] > $compareStats['pageViews'], |
298 | - 'usersData' => $statsByDate->slice(1)->take(29)->map(function ($stat) { |
|
298 | + 'usersData' => $statsByDate->slice(1)->take(29)->map(function($stat) { |
|
299 | 299 | return $stat['users']; |
300 | 300 | }), |
301 | - 'pageViewsData' => $statsByDate->slice(1)->take(29)->map(function ($stat) { |
|
301 | + 'pageViewsData' => $statsByDate->slice(1)->take(29)->map(function($stat) { |
|
302 | 302 | return $stat['pageViews']; |
303 | 303 | }), |
304 | 304 | ]; |
@@ -321,10 +321,10 @@ discard block |
||
321 | 321 | 'stats' => $stats, |
322 | 322 | 'moreUsers' => $stats['users'] > $compareStats['users'], |
323 | 323 | 'morePageViews' => $stats['pageViews'] > $compareStats['pageViews'], |
324 | - 'usersData' => $statsByDate->slice(1)->take(29)->map(function ($stat) { |
|
324 | + 'usersData' => $statsByDate->slice(1)->take(29)->map(function($stat) { |
|
325 | 325 | return $stat['users']; |
326 | 326 | }), |
327 | - 'pageViewsData' => $statsByDate->slice(1)->take(29)->map(function ($stat) { |
|
327 | + 'pageViewsData' => $statsByDate->slice(1)->take(29)->map(function($stat) { |
|
328 | 328 | return $stat['pageViews']; |
329 | 329 | }), |
330 | 330 | ]; |
@@ -350,9 +350,9 @@ discard block |
||
350 | 350 | */ |
351 | 351 | private function getShortcuts($modules) |
352 | 352 | { |
353 | - return $modules->filter(function ($module) { |
|
353 | + return $modules->filter(function($module) { |
|
354 | 354 | return ($module['count'] ?? false) || ($module['create'] ?? false); |
355 | - })->map(function ($module) { |
|
355 | + })->map(function($module) { |
|
356 | 356 | $repository = $this->getRepository($module['name'], $module['repository'] ?? null); |
357 | 357 | |
358 | 358 | $moduleOptions = [ |
@@ -389,9 +389,9 @@ discard block |
||
389 | 389 | */ |
390 | 390 | private function getDrafts($modules) |
391 | 391 | { |
392 | - return $modules->filter(function ($module) { |
|
392 | + return $modules->filter(function($module) { |
|
393 | 393 | return ($module['draft'] ?? false); |
394 | - })->map(function ($module) { |
|
394 | + })->map(function($module) { |
|
395 | 395 | $repository = $this->getRepository($module['name'], $module['repository'] ?? null); |
396 | 396 | |
397 | 397 | $query = $repository->draft()->limit(3)->latest(); |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | |
403 | 403 | $drafts = $query->get(); |
404 | 404 | |
405 | - return $drafts->map(function ($draft) use ($module) { |
|
405 | + return $drafts->map(function($draft) use ($module) { |
|
406 | 406 | return [ |
407 | 407 | 'type' => ucfirst($module['label_singular'] ?? Str::singular($module['name'])), |
408 | 408 | 'name' => $draft->titleInDashboard ?? $draft->title, |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | "$this->viewPrefix.index", |
330 | 330 | "twill::$this->moduleName.index", |
331 | 331 | "twill::layouts.listing", |
332 | - ])->first(function ($view) { |
|
332 | + ])->first(function($view) { |
|
333 | 333 | return View::exists($view); |
334 | 334 | }); |
335 | 335 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | "$this->viewPrefix.form", |
421 | 421 | "twill::$this->moduleName.form", |
422 | 422 | "twill::layouts.form", |
423 | - ])->first(function ($view) { |
|
423 | + ])->first(function($view) { |
|
424 | 424 | return View::exists($view); |
425 | 425 | }); |
426 | 426 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | "$this->viewPrefix.form", |
537 | 537 | "twill::$this->moduleName.form", |
538 | 538 | "twill::layouts.form", |
539 | - ])->first(function ($view) { |
|
539 | + ])->first(function($view) { |
|
540 | 540 | return View::exists($view); |
541 | 541 | }); |
542 | 542 | |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | $query = $this->request->input('q'); |
784 | 784 | $tags = $this->repository->getTags($query); |
785 | 785 | |
786 | - return Response::json(['items' => $tags->map(function ($tag) { |
|
786 | + return Response::json(['items' => $tags->map(function($tag) { |
|
787 | 787 | return $tag->name; |
788 | 788 | })], 200); |
789 | 789 | } |
@@ -870,8 +870,8 @@ discard block |
||
870 | 870 | protected function getIndexTableData($items) |
871 | 871 | { |
872 | 872 | $translated = $this->moduleHas('translations'); |
873 | - return $items->map(function ($item) use ($translated) { |
|
874 | - $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function ($column) use ($item) { |
|
873 | + return $items->map(function($item) use ($translated) { |
|
874 | + $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function($column) use ($item) { |
|
875 | 875 | return $this->getItemColumnData($item, $column); |
876 | 876 | })->toArray(); |
877 | 877 | |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | 'feature', |
1131 | 1131 | 'bulkFeature', |
1132 | 1132 | 'bulkDelete', |
1133 | - ])->mapWithKeys(function ($endpoint) { |
|
1133 | + ])->mapWithKeys(function($endpoint) { |
|
1134 | 1134 | return [ |
1135 | 1135 | $endpoint . 'Url' => $this->getIndexOption($endpoint) ? moduleRoute( |
1136 | 1136 | $this->moduleName, $this->routePrefix, $endpoint, |
@@ -1146,7 +1146,7 @@ discard block |
||
1146 | 1146 | */ |
1147 | 1147 | protected function getIndexOption($option) |
1148 | 1148 | { |
1149 | - return once(function () use ($option) { |
|
1149 | + return once(function() use ($option) { |
|
1150 | 1150 | $customOptionNamesMapping = [ |
1151 | 1151 | 'store' => 'create', |
1152 | 1152 | ]; |
@@ -1202,8 +1202,8 @@ discard block |
||
1202 | 1202 | { |
1203 | 1203 | $withImage = $this->moduleHas('medias'); |
1204 | 1204 | |
1205 | - return $items->map(function ($item) use ($withImage) { |
|
1206 | - $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function ($column) use ($item) { |
|
1205 | + return $items->map(function($item) use ($withImage) { |
|
1206 | + $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function($column) use ($item) { |
|
1207 | 1207 | return $this->getItemColumnData($item, $column); |
1208 | 1208 | })->toArray(); |
1209 | 1209 | |
@@ -1269,7 +1269,7 @@ discard block |
||
1269 | 1269 | $fieldSplitted = explode('|', $field); |
1270 | 1270 | if (count($fieldSplitted) > 1) { |
1271 | 1271 | $requestValue = $requestFilters[$key]; |
1272 | - Collection::make($fieldSplitted)->each(function ($scopeKey) use (&$scope, $requestValue) { |
|
1272 | + Collection::make($fieldSplitted)->each(function($scopeKey) use (&$scope, $requestValue) { |
|
1273 | 1273 | $scope[$scopeKey] = $requestValue; |
1274 | 1274 | }); |
1275 | 1275 | } 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 | |
@@ -1515,7 +1515,7 @@ discard block |
||
1515 | 1515 | $appUrl = Config::get('app.url'); |
1516 | 1516 | |
1517 | 1517 | if (blank(parse_url($appUrl)['scheme'] ?? null)) { |
1518 | - $appUrl = $this->request->getScheme() . '://' . $appUrl; |
|
1518 | + $appUrl = $this->request->getScheme() . '://' . $appUrl; |
|
1519 | 1519 | } |
1520 | 1520 | |
1521 | 1521 | return $appUrl . '/' |