<?php

namespace Database\Seeders;

use App\Models\Website\BranchType;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class BranchTypeSeederTable extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // if (\App::environment('local')) {
        //     BranchType::truncate();
        // }
        $Types = [
            [
                'name'       => 'Branches',
                'code'       => 'BRANCHES',
                'Status'     => '1',
                'company_id' => 1,
            ],
            [
                'name'       => 'Franchisee',
                'code'       => 'FRANCHISEE',
                'Status'     => '1',
                'company_id' => 1,
            ]
        ];
        foreach ($Types as $data) {
            BranchType::firstOrCreate(
                ['code' => $data['code']],
                $data
            );
        }
    }
}
