<?php

namespace Database\DummyNamespace;

use Dcat\Admin\Models;
use Illuminate\Database\Seeder;
use DB;

class DummyClass extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // base tables
        ClassMenu::truncate();
        ClassMenu::insert(
            ArrayMenu
        );

        ClassPermission::truncate();
        ClassPermission::insert(
            ArrayPermission
        );

        ClassRole::truncate();
        ClassRole::insert(
            ArrayRole
        );

        ClassSetting::truncate();
		ClassSetting::insert(
			ArraySetting
		);

		ClassExtension::truncate();
		ClassExtension::insert(
			ArrayExtension
		);

		ClassExtensionHistory::truncate();
		ClassExtensionHistory::insert(
			ArrayExtHistory
		);

        // pivot tables
        DB::table('TablePermissionMenu')->truncate();
		DB::table('TablePermissionMenu')->insert(
			ArrayPivotPermissionMenu
		);

        DB::table('TableRoleMenu')->truncate();
        DB::table('TableRoleMenu')->insert(
            ArrayPivotRoleMenu
        );

        DB::table('TableRolePermissions')->truncate();
        DB::table('TableRolePermissions')->insert(
            ArrayPivotRolePermissions
        );

        // users tables
        ClassUsers::truncate();
        ClassUsers::insert(
            ArrayUsers
        );

        DB::table('TableRoleUsers')->truncate();
        DB::table('TableRoleUsers')->insert(
            ArrayPivotRoleUsers
        );

        // finish
    }
}
