<?php

namespace Database\Seeders;

use App\Models\User;
use Faker\Factory as Faker;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class UserSeeder extends Seeder
{
    public function run()
    {
        if (!app()->environment('local')) {
            return;
        }

        $faker = Faker::create('id_ID');

        for ($x = 0; $x < 10; $x++) {
            User::create([
                'full_name'    => $faker->name,
                'email'        => $faker->unique()->safeEmail,
                'phone_number' => '085349680016',
                'username'     => $faker->unique()->userName,
                'password'     => Hash::make($faker->password),
                'balance'      => 0,
                'level'        => 'Member',
                'api_key'      => create_api_key(),
                'is_verified'  => '1',
            ]);
        }
    }
}