<?php

namespace Database\Seeders;

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

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

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

        ProductGroup::firstOrCreate(['code' => 'GENERAL'], $group);
    }
}
