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);
|
||||
$baderechSet = $setRepository->find(1);
|
||||
$rootIconImageUrl = $this->seedStorageFile(
|
||||
base_path(
|
||||
'../frontend/rabbi_gerzi/public/assets/'
|
||||
. 'baderech-haavodah-icon.png',
|
||||
),
|
||||
'element-icons/baderech-haavodah-icon.png',
|
||||
);
|
||||
$introductionPdfPath = $this->seedStorageFile(
|
||||
base_path(
|
||||
'../frontend/rabbi_gerzi/public/assets/pdfs/baderech.pdf',
|
||||
),
|
||||
'element-pdfs/baderech.pdf',
|
||||
);
|
||||
|
||||
|
|
@ -132,9 +125,11 @@ class ElementSeeder extends Seeder
|
|||
}
|
||||
|
||||
private function seedStorageFile(
|
||||
string $sourcePath,
|
||||
string $storagePath,
|
||||
): string {
|
||||
$sourcePath = base_path(
|
||||
"database/seeders/assets/$storagePath",
|
||||
);
|
||||
$contents = file_get_contents($sourcePath);
|
||||
if ($contents === false) {
|
||||
throw new RuntimeException("Seed file missing: $sourcePath");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue