<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\User;
use Illuminate\Support\Str;

class UsersSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // Super User
        // User::create([
        //     'id_card' => "18105179",
        //     'name' => 'Edgar',
        //     'surname' => 'Rojas',
        //     'phone_number' => "04168593648 ",
        //     'email' => "edgarrojas2904@gmail.com",
        //     'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
        //     'remember_token' => Str::random(10),
        //     'email_verified_at' => now(),
        // ]);

        // $file = file_get_contents('database/seeders/data/users-imported.json');
        // $json = json_decode($file);

        // foreach ($json as $item) {
        //     $user = User::where('id_card', $item->idCard)->first();
        //     if (!$user){
        //         User::create([
        //             'id_card' => $item->idCard,
        //             'name' => 'Sin Nombre',
        //             'surname' => 'Sin Apelldio',
        //             'phone_number' => $item->phoneNumber,
        //             // 'email' => 'indefinido',
        //             'email' => fake()->unique()->safeEmail(),
        //             'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
        //             'remember_token' => Str::random(10),
        //             'email_verified_at' => now(),
        //         ]);
        //     } else {
        //         print($item->idCard . ' is registered') . PHP_EOL;
        //     }
        // }
    }
}
