@@ -44,7 +44,7 @@ public function index($themeCode)
4444 'config ' => [
4545 'baseUrl ' => parse_url (route ('visual.admin.editor ' , ['theme ' => $ themeCode ]), PHP_URL_PATH ),
4646 'imagesBaseUrl ' => Storage::disk (config ('bagisto_visual.images_storage ' ))->url ('' ),
47- 'storefrontUrl ' => url ('/ ' ) . '? ' . http_build_query (['_designMode ' => $ themeCode ]),
47+ 'storefrontUrl ' => url ('/ ' ). '? ' . http_build_query (['_designMode ' => $ themeCode ]),
4848 'channels ' => $ this ->getChannels (),
4949 'defaultChannel ' => core ()->getDefaultChannelCode (),
5050 'blockSchemas ' => $ this ->loadBlocks (),
@@ -140,7 +140,7 @@ public function uploadImages(Request $request)
140140 return $ images ->map (function ($ image ) {
141141 $ originalName = pathinfo ($ image ->getClientOriginalName (), PATHINFO_FILENAME );
142142 $ extension = $ image ->guessExtension ();
143- $ storedName = bin2hex ($ originalName ) . '_ ' . uniqid () . '. ' . $ extension ;
143+ $ storedName = bin2hex ($ originalName ). '_ ' . uniqid (). '. ' . $ extension ;
144144
145145 $ path = $ image ->storeAs (
146146 config ('bagisto_visual.images_directory ' ),
@@ -215,15 +215,15 @@ public function icons(Request $request, Factory $factory, IconsManifest $iconsMa
215215
216216 $ icons ->push ([
217217 'name ' => $ name ,
218- 'id ' => $ set ['prefix ' ] . '- ' . $ name ,
218+ 'id ' => $ set ['prefix ' ]. '- ' . $ name ,
219219 'svg ' => File::get ($ file ->getRealPath ()),
220220 ]);
221221 }
222222 }
223223
224224 return [
225225 'currentSet ' => $ selectedSet ,
226- 'sets ' => collect ($ sets )->map (fn ($ set , $ key ) => ['id ' => $ key , 'prefix ' => $ set ['prefix ' ], 'name ' => Str::headline ($ key )])->values (),
226+ 'sets ' => collect ($ sets )->map (fn ($ set , $ key ) => ['id ' => $ key , 'prefix ' => $ set ['prefix ' ], 'name ' => Str::headline ($ key )])->values (),
227227 'icons ' => $ icons ->values (),
228228 ];
229229 }
@@ -266,7 +266,7 @@ protected function loadBlocks()
266266 'category ' => $ blockSchema ->category ,
267267 'description ' => $ blockSchema ->description ,
268268 'previewImageUrl ' => asset ($ blockSchema ->previewImageUrl ),
269- 'isSection ' => collect ([SimpleSection::class, BladeSection::class, LivewireSection::class])->some (fn ($ class ) => is_subclass_of ($ blockSchema ->class , $ class )),
269+ 'isSection ' => collect ([SimpleSection::class, BladeSection::class, LivewireSection::class])->some (fn ($ class ) => is_subclass_of ($ blockSchema ->class , $ class )),
270270 'enabledOn ' => $ blockSchema ->enabledOn ?? [],
271271 'disabledOn ' => $ blockSchema ->disabledOn ?? [],
272272 ],
@@ -298,7 +298,7 @@ protected function loadTheme($themeCode)
298298 protected function loadTemplates ()
299299 {
300300 return collect (app (\BagistoPlus \Visual \ThemeEditor::class)->getTemplates ())
301- ->map (fn ($ template ) => [
301+ ->map (fn ($ template ) => [
302302 'template ' => $ template ->template ,
303303 'label ' => $ template ->label ,
304304 'icon ' => $ template ->icon ,
@@ -335,7 +335,7 @@ protected function translateSettingsSchema(array $settingsSchema): array
335335
336336 protected function getChannels ()
337337 {
338- return core ()->getAllChannels ()->map (fn ($ channel ) => [
338+ return core ()->getAllChannels ()->map (fn ($ channel ) => [
339339 'code ' => $ channel ->code ,
340340 'name ' => $ channel ->name ,
341341 'locales ' => $ channel ->locales ,
@@ -346,7 +346,7 @@ protected function getChannels()
346346 protected function getChannelCodes (): array
347347 {
348348 return $ this ->getChannels ()
349- ->map (fn ($ channel ) => $ channel ['code ' ])
349+ ->map (fn ($ channel ) => $ channel ['code ' ])
350350 ->toArray ();
351351 }
352352
@@ -358,14 +358,14 @@ protected function getLocaleCodes(string $channel): array
358358 return [];
359359 }
360360
361- return $ channel ['locales ' ]->map (fn ($ locale ) => $ locale ['code ' ])->toArray ();
361+ return $ channel ['locales ' ]->map (fn ($ locale ) => $ locale ['code ' ])->toArray ();
362362 }
363363
364364 protected function getVisualThemes (): array
365365 {
366366 return collect (config ('themes.shop ' , []))
367- ->filter (fn ($ config ) => $ config ['visual_theme ' ] ?? false )
368- ->map (fn ($ config ) => $ config ['code ' ])
367+ ->filter (fn ($ config ) => $ config ['visual_theme ' ] ?? false )
368+ ->map (fn ($ config ) => $ config ['code ' ])
369369 ->toArray ();
370370 }
371371
0 commit comments