ldc-legaulois/database/seeders/Development/HistoricalMilestoneSeeder.php
2026-09-25 16:25:31 +02:00

27 lines
814 B
PHP

<?php
namespace Database\Seeders\Development;
use App\Lib\Helpers\FileStorageHelper;
use App\Models\HistoricalMilestone;
use Illuminate\Database\Seeder;
class HistoricalMilestoneSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
HistoricalMilestone::factory(20)->make()->each(function (HistoricalMilestone $historicalMilestone) {
$historicalMilestone->picture = FileStorageHelper::storeFile(
$historicalMilestone,
new \SplFileInfo(\resource_path(
'../database/factories/assets/historical_milestones/default-picture-608x342.png'
))
);
$historicalMilestone->picto = null;
$historicalMilestone->saveQuietly();
});
}
}