<?php

namespace Database\Seeders;

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

class CategorySeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $categories = [
            [
                'name' => 'Burgers',
                'slug' => 'burgers',
                'description' => 'Delicious homemade burgers',
                'status' => true,
            ],
            [
                'name' => 'Pizza',
                'slug' => 'pizza',
                'description' => 'Fresh pizzas with various toppings',
                'status' => true,
            ],
            [
                'name' => 'Pasta',
                'slug' => 'pasta',
                'description' => 'Italian pasta dishes',
                'status' => true,
            ],
            [
                'name' => 'Desserts',
                'slug' => 'desserts',
                'description' => 'Sweet desserts and treats',
                'status' => true,
            ],
        ];

        foreach ($categories as $category) {
            Category::firstOrCreate(
                ['slug' => $category['slug']],
                $category
            );
        }
    }
}
