feat(website-assets): update ShopIt website assets and adjust favicon paths
This commit is contained in:
@@ -40,7 +40,7 @@ class WebsiteTypeSeeder extends Seeder
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
$shopIt = $this->websiteTypeService->updateOrCreate(
|
||||
$this->websiteTypeService->updateOrCreate(
|
||||
['codigo' => 'shopit'],
|
||||
[
|
||||
'nombre' => 'ShopIt',
|
||||
@@ -48,9 +48,10 @@ class WebsiteTypeSeeder extends Seeder
|
||||
'scanner_domain' => 'scanner.localhost',
|
||||
'site_title' => 'ShopIt',
|
||||
...self::PRESENTATION,
|
||||
'site_logo' => $this->onTicketLogo(),
|
||||
'footer_logo' => $this->onTicketFooterLogo(),
|
||||
'favicon' => $this->onTicketFavicon(),
|
||||
'primary_color' => '#2FD3AC',
|
||||
'site_logo' => $this->shopItLogo(),
|
||||
'footer_logo' => $this->shopItFooterLogo(),
|
||||
'favicon' => $this->shopItFavicon(),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -83,7 +84,7 @@ class WebsiteTypeSeeder extends Seeder
|
||||
...self::PRESENTATION,
|
||||
'site_logo' => $this->onTicketLogo(),
|
||||
'footer_logo' => $this->onTicketFooterLogo(),
|
||||
'favicon' => $shopIt->favicon()->firstOrFail()->key,
|
||||
'favicon' => $this->onTicketFavicon(),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -204,7 +205,7 @@ class WebsiteTypeSeeder extends Seeder
|
||||
|
||||
private function onTicketLogo(): UploadedFile
|
||||
{
|
||||
$path = public_path('images/website_types/onticket_logo.png');
|
||||
$path = public_path('images/website_types/onticket/onticket_logo.png');
|
||||
|
||||
if (! file_exists($path)) {
|
||||
throw new RuntimeException("OnTicket logo not found at path: {$path}");
|
||||
@@ -221,7 +222,7 @@ class WebsiteTypeSeeder extends Seeder
|
||||
|
||||
private function onTicketFooterLogo(): UploadedFile
|
||||
{
|
||||
$path = public_path('images/website_types/onticket_footer_logo.png');
|
||||
$path = public_path('images/website_types/onticket/onticket_footer_logo.png');
|
||||
|
||||
if (! file_exists($path)) {
|
||||
throw new RuntimeException("OnTicket footer logo not found at path: {$path}");
|
||||
@@ -238,7 +239,7 @@ class WebsiteTypeSeeder extends Seeder
|
||||
|
||||
private function onTicketFavicon(): UploadedFile
|
||||
{
|
||||
$path = public_path('images/website_types/onticket_favicon.svg');
|
||||
$path = public_path('images/website_types/onticket/onticket_favicon.svg');
|
||||
|
||||
if (! file_exists($path)) {
|
||||
throw new RuntimeException("OnTicket favicon not found at path: {$path}");
|
||||
@@ -252,4 +253,30 @@ class WebsiteTypeSeeder extends Seeder
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
private function shopItLogo(): UploadedFile
|
||||
{
|
||||
return $this->uploadedImage('shopit', 'shopit_logo.png', 'image/png');
|
||||
}
|
||||
|
||||
private function shopItFooterLogo(): UploadedFile
|
||||
{
|
||||
return $this->uploadedImage('shopit', 'shopit_footer_logo.png', 'image/png');
|
||||
}
|
||||
|
||||
private function shopItFavicon(): UploadedFile
|
||||
{
|
||||
return $this->uploadedImage('shopit', 'shopit-favicon.svg', 'image/svg+xml');
|
||||
}
|
||||
|
||||
private function uploadedImage(string $websiteType, string $filename, string $mimeType): UploadedFile
|
||||
{
|
||||
$path = public_path("images/website_types/{$websiteType}/{$filename}");
|
||||
|
||||
if (! file_exists($path)) {
|
||||
throw new RuntimeException("Website type image not found at path: {$path}");
|
||||
}
|
||||
|
||||
return new UploadedFile($path, $filename, $mimeType, null, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user