ldc-gen-game-web/database/seeders/RangeSeeder.php
Jérémy Munsch 232bc2f459
Tons of Bo fixes related to product and ranges,
add picture alt and titles + seeders + correct config
picture sizes
2023-11-29 15:33:23 +01:00

28 lines
656 B
PHP

<?php
namespace Database\Seeders;
use App\Lib\Helpers\FileStorageHelper;
use App\Models\Range;
use Illuminate\Database\Seeder;
class RangeSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{
Range::factory(6)->make()->each(function (Range $range) {
$range->picture = FileStorageHelper::storeFile(
new Range(),
new \SplFileInfo(
\resource_path('../database/factories/assets/ranges/default-picture-476x355.jpg')
)
);
$range->saveQuietly();
});
}
}