@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | |
| 354 | 354 | return collect( |
| 355 | 355 | config('twill.block_editor.directories.source.icons') |
| 356 | - )->reduce(function ($keep, $path) use ($icon) { |
|
| 356 | + )->reduce(function($keep, $path) use ($icon) { |
|
| 357 | 357 | if ($keep) { |
| 358 | 358 | return $keep; |
| 359 | 359 | } |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | return null; |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - return collect($this->files->files($path))->reduce(function ($keep, SplFileInfo $file) use ($icon) { |
|
| 365 | + return collect($this->files->files($path))->reduce(function($keep, SplFileInfo $file) use ($icon) { |
|
| 366 | 366 | if ($keep) { |
| 367 | 367 | return $keep; |
| 368 | 368 | } |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | if (Schema::hasTable(config('twill.related_table', 'twill_related'))) { |
| 47 | 47 | $relatedItems = Collection::make(); |
| 48 | 48 | |
| 49 | - Collection::make($fields['browsers'])->each(function ($items, $browserName) use (&$relatedItems) { |
|
| 50 | - Collection::make($items)->each(function ($item) use ($browserName, &$relatedItems) { |
|
| 49 | + Collection::make($fields['browsers'])->each(function($items, $browserName) use (&$relatedItems) { |
|
| 50 | + Collection::make($items)->each(function($item) use ($browserName, &$relatedItems) { |
|
| 51 | 51 | try { |
| 52 | 52 | $repository = $this->getModelRepository($item['endpointType'] ?? $browserName); |
| 53 | 53 | $relatedItems->push((object) [ |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | if (Schema::hasTable(config('twill.related_table', 'twill_related'))) { |
| 77 | 77 | if (isset($fields['browsers'])) { |
| 78 | - Collection::make($fields['browsers'])->each(function ($items, $browserName) use ($object) { |
|
| 78 | + Collection::make($fields['browsers'])->each(function($items, $browserName) use ($object) { |
|
| 79 | 79 | $object->saveRelated($items, $browserName); |
| 80 | 80 | }); |
| 81 | 81 | } |
@@ -107,14 +107,14 @@ discard block |
||
| 107 | 107 | $blocksList = app(BlockCollection::class)->getBlockList(); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - $block['type'] = $blocksList->keyBy('name')->search(function ($blockConfig) use ($block) { |
|
| 110 | + $block['type'] = $blocksList->keyBy('name')->search(function($blockConfig) use ($block) { |
|
| 111 | 111 | return $blockConfig['component'] === $block['type']; |
| 112 | 112 | }); |
| 113 | 113 | |
| 114 | 114 | $block['content'] = empty($block['content']) ? new \stdClass : (object) $block['content']; |
| 115 | 115 | |
| 116 | 116 | if ($block['browsers']) { |
| 117 | - $browsers = Collection::make($block['browsers'])->map(function ($items) { |
|
| 117 | + $browsers = Collection::make($block['browsers'])->map(function($items) { |
|
| 118 | 118 | return Collection::make($items)->pluck('id'); |
| 119 | 119 | })->toArray(); |
| 120 | 120 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $relationRepository = $this->getModelRepository($relation, $model); |
| 64 | 64 | |
| 65 | 65 | if (!$keepExisting) { |
| 66 | - $object->$relation()->each(function ($repeaterElement) { |
|
| 66 | + $object->$relation()->each(function($repeaterElement) { |
|
| 67 | 67 | $repeaterElement->forceDelete(); |
| 68 | 68 | }); |
| 69 | 69 | } |
@@ -236,8 +236,8 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | if (isset($relatedItemFormFields['medias'])) { |
| 238 | 238 | if (config('twill.media_library.translated_form_fields', false)) { |
| 239 | - Collection::make($relatedItemFormFields['medias'])->each(function ($rolesWithMedias, $locale) use (&$repeatersMedias, $relation, $relationItem) { |
|
| 240 | - $repeatersMedias[] = Collection::make($rolesWithMedias)->mapWithKeys(function ($medias, $role) use ($locale, $relation, $relationItem) { |
|
| 239 | + Collection::make($relatedItemFormFields['medias'])->each(function($rolesWithMedias, $locale) use (&$repeatersMedias, $relation, $relationItem) { |
|
| 240 | + $repeatersMedias[] = Collection::make($rolesWithMedias)->mapWithKeys(function($medias, $role) use ($locale, $relation, $relationItem) { |
|
| 241 | 241 | return [ |
| 242 | 242 | "blocks[$relation-$relationItem->id][$role][$locale]" => $medias, |
| 243 | 243 | ]; |
@@ -251,8 +251,8 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | if (isset($relatedItemFormFields['files'])) { |
| 254 | - Collection::make($relatedItemFormFields['files'])->each(function ($rolesWithFiles, $locale) use (&$repeatersFiles, $relation, $relationItem) { |
|
| 255 | - $repeatersFiles[] = Collection::make($rolesWithFiles)->mapWithKeys(function ($files, $role) use ($locale, $relation, $relationItem) { |
|
| 254 | + Collection::make($relatedItemFormFields['files'])->each(function($rolesWithFiles, $locale) use (&$repeatersFiles, $relation, $relationItem) { |
|
| 255 | + $repeatersFiles[] = Collection::make($rolesWithFiles)->mapWithKeys(function($files, $role) use ($locale, $relation, $relationItem) { |
|
| 256 | 256 | return [ |
| 257 | 257 | "blocks[$relation-$relationItem->id][$role][$locale]" => $files, |
| 258 | 258 | ]; |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | protected function getRepeaters() |
| 304 | 304 | { |
| 305 | - return collect($this->repeaters)->map(function ($repeater, $key) { |
|
| 305 | + return collect($this->repeaters)->map(function($repeater, $key) { |
|
| 306 | 306 | $repeaterName = is_string($repeater) ? $repeater : $key; |
| 307 | 307 | return [ |
| 308 | 308 | 'relation' => !empty($repeater['relation']) ? $repeater['relation'] : $this->inferRelationFromRepeaterName($repeaterName), |
@@ -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])->map(function ($media) { |
|
| 125 | + $medias = [ |
|
| 126 | + $role => Collection::make($settingsFields['medias'][$role])->map(function($media) { |
|
| 127 | 127 | return json_decode($media, true); |
| 128 | 128 | })->values()->filter()->toArray(), |
| 129 | 129 | ]; |
@@ -23,18 +23,18 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function __construct(array $attributes = []) |
| 25 | 25 | { |
| 26 | - $this->fillable(array_merge($this->fillable, Collection::make(config('twill.media_library.extra_metadatas_fields'))->map(function ($field) { |
|
| 26 | + $this->fillable(array_merge($this->fillable, Collection::make(config('twill.media_library.extra_metadatas_fields'))->map(function($field) { |
|
| 27 | 27 | return $field['name']; |
| 28 | 28 | })->toArray())); |
| 29 | 29 | |
| 30 | - Collection::make(config('twill.media_library.translatable_metadatas_fields'))->each(function ($field) { |
|
| 30 | + Collection::make(config('twill.media_library.translatable_metadatas_fields'))->each(function($field) { |
|
| 31 | 31 | $this->casts[$field] = 'json'; |
| 32 | 32 | }); |
| 33 | 33 | |
| 34 | 34 | parent::__construct($attributes); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public function scopeUnused ($query) |
|
| 37 | + public function scopeUnused($query) |
|
| 38 | 38 | { |
| 39 | 39 | $usedIds = DB::table(config('twill.mediables_table'))->get()->pluck('media_id'); |
| 40 | 40 | return $query->whereNotIn('id', $usedIds->toArray())->get(); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | 'medium' => ImageService::getUrl($this->uuid, ["h" => "430"]), |
| 76 | 76 | 'width' => $this->width, |
| 77 | 77 | 'height' => $this->height, |
| 78 | - 'tags' => $this->tags->map(function ($tag) { |
|
| 78 | + 'tags' => $this->tags->map(function($tag) { |
|
| 79 | 79 | return $tag->name; |
| 80 | 80 | }), |
| 81 | 81 | 'deleteUrl' => $this->canDeleteSafely() ? moduleRoute('medias', 'media-library', 'destroy', $this->id) : null, |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | 'caption' => $this->caption, |
| 88 | 88 | 'altText' => $this->alt_text, |
| 89 | 89 | 'video' => null, |
| 90 | - ] + Collection::make(config('twill.media_library.extra_metadatas_fields'))->mapWithKeys(function ($field) { |
|
| 90 | + ] + Collection::make(config('twill.media_library.extra_metadatas_fields'))->mapWithKeys(function($field) { |
|
| 91 | 91 | return [ |
| 92 | 92 | $field['name'] => $this->{$field['name']}, |
| 93 | 93 | ]; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if ($this->update($fields) && $this->isReferenced()) |
| 144 | 144 | { |
| 145 | - DB::table(config('twill.mediables_table', 'twill_mediables'))->where('media_id', $this->id)->get()->each(function ($mediable) use ($prevWidth, $prevHeight) { |
|
| 145 | + DB::table(config('twill.mediables_table', 'twill_mediables'))->where('media_id', $this->id)->get()->each(function($mediable) use ($prevWidth, $prevHeight) { |
|
| 146 | 146 | |
| 147 | 147 | if ($prevWidth != $this->width) { |
| 148 | 148 | $mediable->crop_x = 0; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $mediable->crop_h = $this->height; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - DB::table(config('twill.mediables_table', 'twill_mediables'))->where('id', $mediable->id)->update((array)$mediable); |
|
| 157 | + DB::table(config('twill.mediables_table', 'twill_mediables'))->where('id', $mediable->id)->update((array) $mediable); |
|
| 158 | 158 | }); |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | if (!function_exists('dumpUsableSqlQuery')) { |
| 10 | 10 | function dumpUsableSqlQuery($query) |
| 11 | 11 | { |
| 12 | - dd(vsprintf(str_replace('?', '%s', $query->toSql()), array_map(function ($binding) { |
|
| 12 | + dd(vsprintf(str_replace('?', '%s', $query->toSql()), array_map(function($binding) { |
|
| 13 | 13 | return is_numeric($binding) ? $binding : "'{$binding}'"; |
| 14 | 14 | }, $query->getBindings()))); |
| 15 | 15 | } |
@@ -201,12 +201,12 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $blockList = app(BlockCollection::class)->getBlockList(); |
| 203 | 203 | |
| 204 | - $appBlocksList = $blockList->filter(function ($block) { |
|
| 204 | + $appBlocksList = $blockList->filter(function($block) { |
|
| 205 | 205 | return $block['source'] !== A17\Twill\Services\Blocks\Block::SOURCE_TWILL; |
| 206 | 206 | }); |
| 207 | 207 | |
| 208 | 208 | $finalBlockList = $blockList->filter( |
| 209 | - function ($block) use ($blocks, $groups, $appBlocksList) { |
|
| 209 | + function($block) use ($blocks, $groups, $appBlocksList) { |
|
| 210 | 210 | if ($block['group'] === A17\Twill\Services\Blocks\Block::SOURCE_TWILL) { |
| 211 | 211 | if (!collect( |
| 212 | 212 | config('twill.block_editor.use_twill_blocks') |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | if (count($appBlocksList) > 0 && $appBlocksList->contains( |
| 218 | - function ($appBlock) use ($block) { |
|
| 218 | + function($appBlock) use ($block) { |
|
| 219 | 219 | return $appBlock['name'] === $block['name']; |
| 220 | 220 | }) |
| 221 | 221 | ) { |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | $this->call('twill:make:module', [ |
| 45 | 45 | 'moduleName' => $this->argument('moduleName'), |
| 46 | - ] + $options->mapWithKeys(function ($value, $key) { |
|
| 46 | + ] + $options->mapWithKeys(function($value, $key) { |
|
| 47 | 47 | return ["--{$key}" => $value]; |
| 48 | 48 | })->toArray()); |
| 49 | 49 | } |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (config('twill.enabled.media-library')) { |
| 137 | - $this->app->singleton('imageService', function () { |
|
| 137 | + $this->app->singleton('imageService', function() { |
|
| 138 | 138 | return $this->app->make(config('twill.media_library.image_service')); |
| 139 | 139 | }); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | if (config('twill.enabled.file-library')) { |
| 143 | - $this->app->singleton('fileService', function () { |
|
| 143 | + $this->app->singleton('fileService', function() { |
|
| 144 | 144 | return $this->app->make(config('twill.file_library.file_service')); |
| 145 | 145 | }); |
| 146 | 146 | } |
@@ -346,20 +346,20 @@ discard block |
||
| 346 | 346 | { |
| 347 | 347 | $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler(); |
| 348 | 348 | |
| 349 | - $blade->directive('dd', function ($param) { |
|
| 349 | + $blade->directive('dd', function($param) { |
|
| 350 | 350 | return "<?php dd({$param}); ?>"; |
| 351 | 351 | }); |
| 352 | 352 | |
| 353 | - $blade->directive('dumpData', function ($data) { |
|
| 353 | + $blade->directive('dumpData', function($data) { |
|
| 354 | 354 | return sprintf("<?php (new Symfony\Component\VarDumper\VarDumper)->dump(%s); exit; ?>", |
| 355 | 355 | null != $data ? $data : "get_defined_vars()"); |
| 356 | 356 | }); |
| 357 | 357 | |
| 358 | - $blade->directive('formField', function ($expression) { |
|
| 358 | + $blade->directive('formField', function($expression) { |
|
| 359 | 359 | return $this->includeView('partials.form._', $expression); |
| 360 | 360 | }); |
| 361 | 361 | |
| 362 | - $blade->directive('partialView', function ($expression) { |
|
| 362 | + $blade->directive('partialView', function($expression) { |
|
| 363 | 363 | |
| 364 | 364 | $expressionAsArray = str_getcsv($expression, ',', '\''); |
| 365 | 365 | |
@@ -395,13 +395,13 @@ discard block |
||
| 395 | 395 | ?>"; |
| 396 | 396 | }); |
| 397 | 397 | |
| 398 | - $blade->directive('pushonce', function ($expression) { |
|
| 398 | + $blade->directive('pushonce', function($expression) { |
|
| 399 | 399 | [$pushName, $pushSub] = explode(':', trim(substr($expression, 1, -1))); |
| 400 | 400 | $key = '__pushonce_' . $pushName . '_' . str_replace('-', '_', $pushSub); |
| 401 | 401 | return "<?php if(! isset(\$__env->{$key})): \$__env->{$key} = 1; \$__env->startPush('{$pushName}'); ?>"; |
| 402 | 402 | }); |
| 403 | 403 | |
| 404 | - $blade->directive('endpushonce', function () { |
|
| 404 | + $blade->directive('endpushonce', function() { |
|
| 405 | 405 | return '<?php $__env->stopPush(); endif; ?>'; |
| 406 | 406 | }); |
| 407 | 407 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | View::composer('twill::partials.navigation.*', ActiveNavigation::class); |
| 444 | 444 | |
| 445 | - View::composer(['admin.*', 'templates.*', 'twill::*'], function ($view) { |
|
| 445 | + View::composer(['admin.*', 'templates.*', 'twill::*'], function($view) { |
|
| 446 | 446 | $with = array_merge([ |
| 447 | 447 | 'renderForBlocks' => false, |
| 448 | 448 | '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 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | 'date' => $activity->created_at->toIso8601String(), |
| 180 | 180 | 'author' => $activity->causer->name ?? twillTrans('twill::lang.dashboard.unkown-author'), |
| 181 | 181 | 'name' => $activity->subject->titleInDashboard ?? $activity->subject->title, |
| 182 | - 'activity' => twillTrans('twill::lang.dashboard.activities.'.$activity->description), |
|
| 182 | + 'activity' => twillTrans('twill::lang.dashboard.activities.' . $activity->description), |
|
| 183 | 183 | ] + (classHasTrait($activity->subject, HasMedias::class) ? [ |
| 184 | 184 | 'thumbnail' => $activity->subject->defaultCmsImage(['w' => 100, 'h' => 100]), |
| 185 | 185 | ] : []) + (!$activity->subject->trashed() ? [ |
@@ -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, |