We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fbd2c43 commit e34ca79Copy full SHA for e34ca79
app/Console/Commands/SeedingImage.php
@@ -56,6 +56,8 @@ public function handle()
56
}
57
break;
58
case 'Category':
59
+ $svgs = \File::files(__DIR__ . '/../../../database/seeders/images/svg');
60
+
61
foreach (Category::all() as $item) {
62
$this->info('Category: ' . $item->name . ' adding image...');
63
shuffle($images);
@@ -75,6 +77,9 @@ public function handle()
75
77
->optimize()
76
78
->format('webp');
79
$i->save(storage_path() . '/app/public/categories/optimized-'. $item->bg);
80
+ shuffle($svgs);
81
+ \File::copy($svgs[0]->getRealPath(),storage_path().'/app/public/categories/' . $svgs[0]->getFilename());
82
+ $item->svg = $svgs[0]->getFilename();
83
$item->save();
84
85
0 commit comments