<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;

class MoveImageSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $sourceDirIllustrationsPersonalities = public_path('assets/archive/images/personality');
        $destinationDirillustrationsPersonalities = public_path('storage/illustrations');

        foreach (glob("$sourceDirIllustrationsPersonalities/*") as $file) {
            $fileName = basename($file);
            File::copy($file, "$destinationDirillustrationsPersonalities/$fileName");
        }

        $sourceDirIllustrationsCareer = public_path('assets/archive/images/career');
        $destinationDirillustrationsCareer = public_path('storage/illustrations');

        foreach (glob("$sourceDirIllustrationsCareer/*") as $file) {
            $fileName = basename($file);
            File::copy($file, "$destinationDirillustrationsCareer/$fileName");
        }
    }
}
