<?php

namespace Database\Seeders;

// use Illuminate\Database\Console\Seeds\WithoutModelEvents;

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

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {

        if (User::count() == 0) {
            User::withoutEvents(function () {
                User::create([
                    'name' => "Admin",
                    'email' => "admin@gmail.com",
                    'password' => Hash::make("admin123"),
                ]);
            });
        }
        $this->call(PermissionSeeder::class);
    }
}
