27 lines
814 B
PHP
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();
|
|
});
|
|
}
|
|
}
|