feat(website-assets): update ShopIt website assets and adjust favicon paths
This commit is contained in:
@@ -41,7 +41,7 @@ return new class extends Migration
|
||||
return;
|
||||
}
|
||||
|
||||
$sourcePath = public_path('images/website_types/'.self::FILENAME);
|
||||
$sourcePath = public_path('images/website_types/onticket/'.self::FILENAME);
|
||||
|
||||
if (! is_file($sourcePath)) {
|
||||
throw new RuntimeException("Favicon not found at path: {$sourcePath}");
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use App\Domains\Core\Tenant\Models\AdminWebsiteType;
|
||||
use App\Domains\Core\Tenant\Services\AdminWebsiteTypeService;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if (app()->environment('testing')) {
|
||||
Storage::fake('s3');
|
||||
}
|
||||
|
||||
if (! AdminWebsiteType::query()->where('codigo', 'shopit')->exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
app(AdminWebsiteTypeService::class)->updateOrCreate(
|
||||
['codigo' => 'shopit'],
|
||||
[
|
||||
'primary_color' => '#2FD3AC',
|
||||
'site_logo' => $this->uploadedImage('shopit_logo.png', 'image/png'),
|
||||
'footer_logo' => $this->uploadedImage('shopit_footer_logo.png', 'image/png'),
|
||||
'favicon' => $this->uploadedImage('shopit-favicon.svg', 'image/svg+xml'),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// Brand assets are operational data and are intentionally preserved.
|
||||
}
|
||||
|
||||
private function uploadedImage(string $filename, string $mimeType): UploadedFile
|
||||
{
|
||||
$path = public_path("images/website_types/shopit/{$filename}");
|
||||
|
||||
if (! is_file($path)) {
|
||||
throw new RuntimeException("ShopIt image not found at path: {$path}");
|
||||
}
|
||||
|
||||
return new UploadedFile($path, $filename, $mimeType, null, true);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user