Remove media handling from database seeder

This commit is contained in:
Christopher C. Wells 2021-04-08 07:49:33 -07:00
parent a1d12cdfdd
commit 264a194202
26 changed files with 0 additions and 10 deletions

View File

@ -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++) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 KiB