<?php

namespace Database\Seeders;

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

class ProductCategoriesTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        /**
         * Reset the ProductCategory table
         */
        // if (\App::environment('local')) {
        //     ProductCategory::truncate();
        // }

        $category = [
                'name'       => 'General',
                'code'       => 'GENERAL',
                'priority'   => '1',
                'status'     => '1',
                'is_default' => '1',
            ];

        ProductCategory::firstOrCreate(['code' => 'GENERAL'], $category);
    }
}
