Remove media handling from database seeder
|
@ -11,9 +11,7 @@ use App\Models\User;
|
|||
use App\Support\Nutrients;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
|
@ -46,8 +44,6 @@ class DatabaseSeeder extends Seeder
|
|||
->count(25)
|
||||
->create();
|
||||
|
||||
$storage = Storage::disk('seeder');
|
||||
$photos = new Collection($storage->files('photos'));
|
||||
/** @var \App\Models\Recipe $recipe */
|
||||
foreach ($recipes as $recipe) {
|
||||
$ingredients = [];
|
||||
|
@ -60,12 +56,6 @@ class DatabaseSeeder extends Seeder
|
|||
]);
|
||||
}
|
||||
$recipe->ingredientAmounts()->saveMany($ingredients);
|
||||
|
||||
$recipe->addMediaFromStream($storage->get($photos->pop()))
|
||||
->usingName($recipe->name)
|
||||
->usingFileName("{$recipe->slug}.jpg")
|
||||
->preservingOriginal()
|
||||
->toMediaCollection();
|
||||
}
|
||||
|
||||
for ($i = 0; $i <= 31; $i++) {
|
||||
|
|
Before Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 295 KiB |
Before Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 177 KiB |
Before Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 328 KiB |
Before Width: | Height: | Size: 692 KiB |
Before Width: | Height: | Size: 235 KiB |
Before Width: | Height: | Size: 349 KiB |
Before Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 370 KiB |
Before Width: | Height: | Size: 438 KiB |
Before Width: | Height: | Size: 275 KiB |
Before Width: | Height: | Size: 257 KiB |
Before Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 577 KiB |
Before Width: | Height: | Size: 415 KiB |
Before Width: | Height: | Size: 488 KiB |
Before Width: | Height: | Size: 157 KiB |
Before Width: | Height: | Size: 330 KiB |
Before Width: | Height: | Size: 272 KiB |
Before Width: | Height: | Size: 202 KiB |
Before Width: | Height: | Size: 360 KiB |
Before Width: | Height: | Size: 310 KiB |