<?php

namespace Database\Seeders;

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

class DatabaseSeeder extends Seeder
{
    use WithoutModelEvents;

    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        // Create admin user (if doesn't exist)
        User::firstOrCreate(
            ['email' => 'admin@cataloguebuilder.com'],
            [
                'name' => 'Admin',
                'password' => bcrypt('password'), // Change this password in production!
            ]
        );
        
        // Seed bakery categories
        $this->call(BakeryCategorySeeder::class);
        
        // Seed products
        $this->call(BakeryProductSeeder::class);
        
        // Seed product images
        $this->call(ProductImageSeeder::class);
        
        // Seed inquiries
        $this->call(InquirySeeder::class);
        
        // Seed newsletter subscribers
        $this->call(NewsletterSubscriberSeeder::class);
    }
}
