<?php

namespace Database\Seeders;

use App\Models\Customer;
use App\Models\User;
use Illuminate\Database\Seeder;

class CustomerSeeder extends Seeder
{
    public function run(): void
    {
        for ($i = 0; $i < 500; $i++) {
            $hasUser = fake()->boolean(70);

            $userId = null;

            if ($hasUser) {
                $user = User::factory()->create();
                $userId = $user->id;
            }

            Customer::factory()
                ->create([
                    'user_id' => $userId,
                ]);
        }
    }
}
