use backend seed assets

This commit is contained in:
Yisroel Baum 2026-06-03 08:45:32 +03:00
parent 6c14e193e0
commit 4cf45a761d
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 3 additions and 8 deletions

View file

@ -17,16 +17,9 @@ class ElementSeeder extends Seeder
$elementRepository = app(ElementRepository::class); $elementRepository = app(ElementRepository::class);
$baderechSet = $setRepository->find(1); $baderechSet = $setRepository->find(1);
$rootIconImageUrl = $this->seedStorageFile( $rootIconImageUrl = $this->seedStorageFile(
base_path(
'../frontend/rabbi_gerzi/public/assets/'
. 'baderech-haavodah-icon.png',
),
'element-icons/baderech-haavodah-icon.png', 'element-icons/baderech-haavodah-icon.png',
); );
$introductionPdfPath = $this->seedStorageFile( $introductionPdfPath = $this->seedStorageFile(
base_path(
'../frontend/rabbi_gerzi/public/assets/pdfs/baderech.pdf',
),
'element-pdfs/baderech.pdf', 'element-pdfs/baderech.pdf',
); );
@ -132,9 +125,11 @@ class ElementSeeder extends Seeder
} }
private function seedStorageFile( private function seedStorageFile(
string $sourcePath,
string $storagePath, string $storagePath,
): string { ): string {
$sourcePath = base_path(
"database/seeders/assets/$storagePath",
);
$contents = file_get_contents($sourcePath); $contents = file_get_contents($sourcePath);
if ($contents === false) { if ($contents === false) {
throw new RuntimeException("Seed file missing: $sourcePath"); throw new RuntimeException("Seed file missing: $sourcePath");

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB