feat(seeder): update FiestaTradicionArrufoSeeder to use AVIF image format and validate image existence
This commit is contained in:
@@ -20,7 +20,7 @@ class FiestaTradicionArrufoSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
private const TITLE = '26.º Fiesta de la Tradición y 4.º Encuentro de Agrupaciones Gauchas';
|
private const TITLE = '26.º Fiesta de la Tradición y 4.º Encuentro de Agrupaciones Gauchas';
|
||||||
|
|
||||||
private const IMAGE = __DIR__.'/assets/fiesta-tradicion-arrufo-2026.png';
|
private const IMAGE = 'images/tennants/onticket/events/fiesta-tradicion-arrufo-2026.avif';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CatalogService $catalog,
|
private readonly CatalogService $catalog,
|
||||||
@@ -107,6 +107,12 @@ class FiestaTradicionArrufoSeeder extends Seeder
|
|||||||
|
|
||||||
private function image(): UploadedFile
|
private function image(): UploadedFile
|
||||||
{
|
{
|
||||||
return new UploadedFile(self::IMAGE, basename(self::IMAGE), 'image/png', null, true);
|
$path = public_path(self::IMAGE);
|
||||||
|
|
||||||
|
if (! is_file($path)) {
|
||||||
|
throw new RuntimeException("Image not found at path: {$path}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return new UploadedFile($path, basename($path), 'image/avif', null, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 786 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
Reference in New Issue
Block a user