<?php

namespace Database\Seeders;

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

class CategorySeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $categories = [
            ['name' => 'Organic Vegetables', 'slug' => 'organic-vegetables', 'image' => 'https://nest-frontend-v6.netlify.app/assets/imgs/shop/cat-1.png'],
            ['name' => 'Fresh Fruits', 'slug' => 'fresh-fruits', 'image' => 'https://nest-frontend-v6.netlify.app/assets/imgs/shop/cat-9.png'],
            ['name' => 'Dairy & Eggs', 'slug' => 'dairy-eggs', 'image' => 'https://nest-frontend-v6.netlify.app/assets/imgs/shop/cat-11.png'],
            ['name' => 'Beverages', 'slug' => 'beverages', 'image' => 'https://nest-frontend-v6.netlify.app/assets/imgs/shop/cat-2.png'],
            ['name' => 'Seafood', 'slug' => 'seafood', 'image' => 'https://nest-frontend-v6.netlify.app/assets/imgs/shop/cat-12.png'],
            ['name' => 'Bakery', 'slug' => 'bakery', 'image' => 'https://nest-frontend-v6.netlify.app/assets/imgs/shop/cat-13.png'],
        ];

        foreach ($categories as $cat) {
            \App\Models\Category::updateOrCreate(['slug' => $cat['slug']], $cat);
        }
    }
}
