<?php

namespace Database\Seeders;

// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use DB;

class DatabaseSeeder extends Seeder {

    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run() {
        // init seeders
        $this->initSeeders();

        $this->call([DeleteSeeder::class]);
        $this->call([CompanySeeder::class]);
        $this->call([UserSeeder::class]);
        $this->call([ProfileSeeder::class]);

        // end seeders
        $this->endSeeders();
    }

    public function initSeeders() {
        // disable foreign keys check
        DB::statement("SET foreign_key_checks = 0");
    }

    public function endSeeders() {
        // enable foreign keys check
        DB::statement("SET foreign_key_checks = 1");
    }

}
