Passed
Push — master ( 762638...6f10be )
by Quentin
06:00
created
src/Http/Controllers/Admin/ModuleController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             "$this->viewPrefix.index",
314 314
             "twill::$this->moduleName.index",
315 315
             "twill::layouts.listing",
316
-        ])->first(function ($view) {
316
+        ])->first(function($view) {
317 317
             return View::exists($view);
318 318
         });
319 319
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
             "$this->viewPrefix.form",
394 394
             "twill::$this->moduleName.form",
395 395
             "twill::layouts.form",
396
-        ])->first(function ($view) {
396
+        ])->first(function($view) {
397 397
             return View::exists($view);
398 398
         });
399 399
 
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
             "$this->viewPrefix.form",
510 510
             "twill::$this->moduleName.form",
511 511
             "twill::layouts.form",
512
-        ])->first(function ($view) {
512
+        ])->first(function($view) {
513 513
             return View::exists($view);
514 514
         });
515 515
 
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
         $query = $this->request->input('q');
729 729
         $tags = $this->repository->getTags($query);
730 730
 
731
-        return Response::json(['items' => $tags->map(function ($tag) {
731
+        return Response::json(['items' => $tags->map(function($tag) {
732 732
             return $tag->name;
733 733
         })], 200);
734 734
     }
@@ -813,8 +813,8 @@  discard block
 block discarded – undo
813 813
     protected function getIndexTableData($items)
814 814
     {
815 815
         $translated = $this->moduleHas('translations');
816
-        return $items->map(function ($item) use ($translated) {
817
-            $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function ($column) use ($item) {
816
+        return $items->map(function($item) use ($translated) {
817
+            $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function($column) use ($item) {
818 818
                 return $this->getItemColumnData($item, $column);
819 819
             })->toArray();
820 820
 
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
             'feature',
1070 1070
             'bulkFeature',
1071 1071
             'bulkDelete',
1072
-        ])->mapWithKeys(function ($endpoint) {
1072
+        ])->mapWithKeys(function($endpoint) {
1073 1073
             return [
1074 1074
                 $endpoint . 'Url' => $this->getIndexOption($endpoint) ? moduleRoute(
1075 1075
                     $this->moduleName, $this->routePrefix, $endpoint,
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
      */
1086 1086
     protected function getIndexOption($option)
1087 1087
     {
1088
-        return once(function () use ($option) {
1088
+        return once(function() use ($option) {
1089 1089
             $customOptionNamesMapping = [
1090 1090
                 'store' => 'create',
1091 1091
             ];
@@ -1140,8 +1140,8 @@  discard block
 block discarded – undo
1140 1140
     {
1141 1141
         $withImage = $this->moduleHas('medias');
1142 1142
 
1143
-        return $items->map(function ($item) use ($withImage) {
1144
-            $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function ($column) use ($item) {
1143
+        return $items->map(function($item) use ($withImage) {
1144
+            $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function($column) use ($item) {
1145 1145
                 return $this->getItemColumnData($item, $column);
1146 1146
             })->toArray();
1147 1147
 
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
                     $fieldSplitted = explode('|', $field);
1208 1208
                     if (count($fieldSplitted) > 1) {
1209 1209
                         $requestValue = $requestFilters[$key];
1210
-                        Collection::make($fieldSplitted)->each(function ($scopeKey) use (&$scope, $requestValue) {
1210
+                        Collection::make($fieldSplitted)->each(function($scopeKey) use (&$scope, $requestValue) {
1211 1211
                             $scope[$scopeKey] = $requestValue;
1212 1212
                         });
1213 1213
                     } else {
@@ -1353,11 +1353,11 @@  discard block
 block discarded – undo
1353 1353
      */
1354 1354
     protected function validateFormRequest()
1355 1355
     {
1356
-        $unauthorizedFields = Collection::make($this->fieldsPermissions)->filter(function ($permission, $field) {
1356
+        $unauthorizedFields = Collection::make($this->fieldsPermissions)->filter(function($permission, $field) {
1357 1357
             return Auth::guard('twill_users')->user()->cannot($permission);
1358 1358
         })->keys();
1359 1359
 
1360
-        $unauthorizedFields->each(function ($field) {
1360
+        $unauthorizedFields->each(function($field) {
1361 1361
             $this->request->offsetUnset($field);
1362 1362
         });
1363 1363
 
Please login to merge, or discard this patch.
src/Http/Controllers/Admin/FeaturedController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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([
Please login to merge, or discard this patch.
src/Repositories/BlockRepository.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/ValidationServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,23 +16,23 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/Helpers/frontend_helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                     . '/'
Please login to merge, or discard this patch.
src/TwillServiceProvider.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.
src/Http/Controllers/Admin/DashboardController.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.