<?php

namespace Database\Seeders;

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

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

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

        ProductAttribute::firstOrCreate(['code' => 'GENERAL'], $attribute);
    }
}
