<?php

namespace Database\Seeders;

use App\Models\Brand;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;

class BrandTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        File::copyDirectory(public_path('web/assets/img/brand'), storage_path('app/public/brand'));
        File::chmod(public_path('web/assets/img/brand'), 0777);

        $brands = [
            ['name' => fake()->city, 'image' => 'brand/brand-1.png', 'active' => true],
            ['name' => fake()->city, 'image' => 'brand/brand-2.png', 'active' => true],
            ['name' => fake()->city, 'image' => 'brand/brand-3.png', 'active' => true],
            ['name' => fake()->city, 'image' => 'brand/brand-4.png', 'active' => true],
            ['name' => fake()->city, 'image' => 'brand/brand-5.png', 'active' => true],
            ['name' => fake()->city, 'image' => 'brand/brand-6.png', 'active' => true],
            ['name' => fake()->city, 'image' => 'brand/brand-7.png', 'active' => true],
            ['name' => fake()->city, 'image' => 'brand/brand-8.png', 'active' => true],
        ];

        Brand::insert($brands);
    }
}
