use backend seed assets
This commit is contained in:
parent
6c14e193e0
commit
4cf45a761d
3 changed files with 3 additions and 8 deletions
|
|
@ -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 |
BIN
backend/database/seeders/assets/element-pdfs/baderech.pdf
Normal file
BIN
backend/database/seeders/assets/element-pdfs/baderech.pdf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue