Run the database seeds.

@return void
192704
public function run()
    {
        DB::table('languages')->insert([
            'name'        => 'English',
            'flag'        => '',
            'abbr'        => 'en',
            'script'    => 'Latn',
            'native'    => 'English',
            'active'    => '1',
            'default'    => '1',
        ]);

        DB::table('languages')->insert([
            'name'        => 'Romanian',
            'flag'        => '',
            'abbr'        => 'ro',
            'script'    => 'Latn',
            'native'    => 'română',
            'active'    => '1',
            'default'    => '0',
        ]);

        DB::table('languages')->insert([
            'name'        => 'French',
            'flag'        => '',
            'abbr'        => 'fr',
            'script'    => 'Latn',
            'native'    => 'français',
            'active'    => '0',
            'default'    => '0',
        ]);

        DB::table('languages')->insert([
            'name'        => 'Italian',
            'flag'        => '',
            'abbr'        => 'it',
            'script'    => 'Latn',
            'native'    => 'italiano',
            'active'    => '0',
            'default'    => '0',
        ]);

        DB::table('languages')->insert([
            'name'        => 'Spanish',
            'flag'        => '',
            'abbr'        => 'es',
            'script'    => 'Latn',
            'native'    => 'español',
            'active'    => '0',
            'default'    => '0',
        ]);

        DB::table('languages')->insert([
            'name'        => 'German',
            'flag'        => '',
            'abbr'        => 'de',
            'script'    => 'Latn',
            'native'    => 'Deutsch',
            'active'    => '0',
            'default'    => '0',
        ]);

        $this->command->info('Language seeding successful.');
    }
562102
public function run()
    {
        // php artisan db:seed --class="PermissionsTableSeeder"
        $permissions = [
            [
                'name' => 'manage_users',
            ],
            [
                'name' => 'manage_pages',
            ],
            [
                'name' => 'access_admin',
            ],
        ];

        // Only add new
        $allPermissions = Permission::all()->pluck('name')->toArray();

        foreach ($permissions as $permission) {
            if (! in_array($permission['name'], $allPermissions)) {
                Permission::create($permission);
            }
        }
    }
557148
public function run()
    {
        $this->languages = ['ru', 'en'];

        foreach ($this->languages as $language) {
            Language::create(
                $this->languages()[$language]
            );
        }
    }
814194
public function run()
    {
        $this->seedLessons();
        $this->seedDays();
        $this->seedShifts();
        $this->seedTimeslots();
        $this->seedAttendancesType();
        $this->seedAttendances();
    }
132528
public function run()
    {
        $users = users('member');
        if (empty($users)) {
            return;
        }
        $this->down();
        $insert = [];
        foreach ($users as $user) {
            for ($i = 0; $i < 2; $i++) {
                array_push($insert, $this->createInsert($user->id));
            }
        }
        for ($i = 0; $i < 10; $i++) {
            $user = $users->random();
            array_push($insert, $this->createInsert($user->id));
        }
        DB::table('tbl_custom_module')->insert($insert);
        $widgetParamsSchemaPath = __DIR__ . '/schemas/widget_params.sql';
        if (file_exists($widgetParamsSchemaPath)) {
            DB::unprepared(file_get_contents($widgetParamsSchemaPath));
        }
    }
13995
public function run()
    {
        // php artisan db:seed --class="PermissionRoleTableSeeder"
        $permissions = Permission::all();
        $adminRole = Role::whereName('admin')->first();

        foreach ($permissions as $permission) {
            if (! $adminRole->hasPermissionTo($permission)) {
                $adminRole->givePermissionTo($permission->name);
            }
        }
        $rolePermissions = ['manage_pages', 'access_admin'];

        /** @var Role $editorRole */
        $editorRole = Role::whereName('editor')->first();
        foreach ($rolePermissions as $permission) {
            if (! $editorRole->hasPermissionTo($permission)) {
                $editorRole->givePermissionTo($permission);
            }
        }
    }
1313156
public function run()
    {
        $default = [
            'module_name' => null,
            'action' => 'setting',
            'class' => 'form-control',
            'section' => 'main',
            'fieldset' => 'general',
            'name' => null,
            'type' => 'string',
            'value' => null,
            // '{"id":"id"}'
            'params' => null,
            'html_flags' => 'required',
        ];

        \DB::table('settings')->insert($this->getArticles($default));
        \DB::table('settings')->insert($this->getComments($default));
        \DB::table('settings')->insert($this->getFiles($default));
        \DB::table('settings')->insert($this->getSystem($default));
        \DB::table('settings')->insert($this->getTags($default));
        \DB::table('settings')->insert($this->getThemes($default));
        \DB::table('settings')->insert($this->getUsers($default));
    }
241634
public function run()
    {
        $datas = [
            ['publicable' => true,'key' => 'site_name', 'value' => 'Live CMS'],
            ['publicable' => true,'key' => 'site_initial', 'value' => 'LC'],
            ['publicable' => true,'key' => 'site_email', 'value' => 'no.reply@livecms.dev'],
            ['publicable' => true,'key' => 'slug_admin', 'value' => '@'],
            ['publicable' => true,'key' => 'slug_article', 'value' => 'a'],
            ['publicable' => true,'key' => 'slug_staticpage', 'value' => 'p'],
            ['publicable' => true,'key' => 'slug_search', 'value' => 'search'],
            ['publicable' => true,'key' => 'mailchimp_key', 'value' => ''],
            ['publicable' => true,'key' => 'mailchimp_form_url', 'value' => ''],
            ['publicable' => true,'key' => 'google_analytic_id', 'value' => ''],
        ];

        foreach ($datas as $data) {
            $exist = DB::table('settings')->where(array_only($data, ['publicable', 'key']))->first();
            if (!$exist) {
                DB::table('settings')->insert($data);
            }
            
        }
    }
1374035
public function run()
    {
        foreach (['super', 'admin', 'banned', 'author', 'registered'] as $role) {
            if (DB::table('roles')->where(compact('role'))->first()) {
                continue;
            }

            DB::table('roles')->insert(compact('role'));
        }
    }
100486
public function run()
    {
        $countries = @json_decode(file_get_contents(realpath(__DIR__ . '/../seeds/countries.json'), true));

        DB::table(config('countries.table_name'))->delete();

        foreach ($countries as $countryId => $country) {
            DB::table(config('countries.table_name'))->insert(array(
                'id' => $countryId,
                'capital' => $country->capital ?? null,
                'citizenship' => $country->citizenship ?? null,
                'country_code' => $country->country_code,
                'currency' => $country->currency ?? null,
                'currency_code' => $country->currency_code ?? null,
                'currency_sub_unit' => $country->currency_sub_unit ?? null,
                'currency_decimals' => $country->currency_decimals ?? null,
                'full_name' => $country->full_name ?? null,
                'iso_3166_2' => $country->iso_3166_2,
                'iso_3166_3' => $country->iso_3166_3,
                'name' => $country->name,
                'region_code' => $country->region_code,
                'sub_region_code' => $country->sub_region_code,
                'eea' => (bool) $country->eea,
                'calling_code' => $country->calling_code,
                'currency_symbol' => $country->currency_symbol ?? null,
                'flag' => $country->flag ?? null,
            ));
        }
    }
805683
public function run()
    {
        Model::unguard();

        // Users
        $users = [
            [
                'first_name' => 'Su',
                'last_name' => 'Acl',
                'email' => 'su@acl.com',
                'password' => bcrypt('123'),
                'superuser' => TRUE,
                'remember_token' => str_random(10),
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s'),
            ],
        ];

        DB::table('users')->insert($users);

        // Roles
        $roles = [
            [
                'name' => 'Admin',
                'description' => 'Admin',
            ],
        ];

        DB::table('roles')->insert($roles);
    }
141995
public function run()
    {
        $data = $this->getData();

        // If blade is enabled, initialize it
        if ($this->isBladeEnabled())
        {
            $bladeConfig = $data['blade'];

            // Setup blade and paths
            $viewsPath = $bladeConfig['paths']['views'];
            $cachePath = $bladeConfig['paths']['cache'];
            $blade = new Blade($viewsPath, $cachePath);

            // Extend blade
            /** @var \Illuminate\View\Compilers\BladeCompiler $compiler */
            $compiler = $blade->getCompiler();
            $extensions = array(
                new WordPressLoopExtension(),
                new WordPressQueryExtension(),
                new WordPressShortcodeExtension()
            );

            /** @var Extension $ext */
            foreach ($extensions as $ext)
            {
                $ext->register($compiler);
            }

            // Set the blade engine in the facade
            Baobab::setBlade($blade);
        }
    }
310125
public function run()
    {
        \DB::table('lfm_categories')->delete();
        \DB::table('lfm_categories')->insert(
            array (
                'id' => '0',
                'user_id' => 0,
                'title' => 'Root folder',
                'title_disc' => 'root_folder',
                'description' => 'root',
                'parent_category_id' => '#',
                'created_by' => 0,
                'created_at' => NULL,
                'updated_at' => NULL,
                'deleted_at' => NULL,
            )
        );
        \DB::unprepared("UPDATE lfm_categories SET id=0");
        \DB::table('lfm_categories')->insert(array (
            0 =>
                array (
                    'id' => -5,
                    'user_id' => 0,
                    'title' => 'Direct upload',
                    'title_disc' => 'direct_folder',
                    'description' => 'direct upload folder',
                    'parent_category_id' => '#',
                    'created_by' => 0,
                    'created_at' => NULL,
                    'updated_at' => NULL,
                    'deleted_at' => NULL,
                ),
            1 =>
                array (
                    'id' => -2,
                    'user_id' => 0,
                    'title' => 'Share folder',
                    'title_disc' => 'share_folder',
                    'description' => 'share',
                    'parent_category_id' => '#',
                    'created_by' => 0,
                    'created_at' => NULL,
                    'updated_at' => NULL,
                    'deleted_at' => NULL,
                ),
            2 =>
                array (
                    'id' => -1,
                    'user_id' => 0,
                    'title' => 'public folder',
                    'title_disc' => 'public_folder',
                    'description' => 'public',
                    'parent_category_id' => '#',
                    'created_by' => 0,
                    'created_at' => NULL,
                    'updated_at' => NULL,
                    'deleted_at' => NULL,
                ),
        ));

    }
1140191
public function run()
    {
        $this->command->info('Competitors seeding!');
        $userClass = config('laravel-tournaments.user.model');
        $championship = Championship::where('tournament_id', 1)->first();

        $users[] = factory($userClass)->create(['name' => 't1']);
        $users[] = factory($userClass)->create(['name' => 't2']);
        $users[] = factory($userClass)->create(['name' => 't3']);
        $users[] = factory($userClass)->create(['name' => 't4']);
        $users[] = factory($userClass)->create(['name' => 't5']);

        foreach ($users as $user) {
            factory(Competitor::class)->create([
                'championship_id' => $championship->id,
                'user_id' => $user->id,
                'confirmed' => 1,
            ]);
        }
    }
814386
public function seedDatabase(): void
    {
        (new SeedSiteSettingTable())->run();
        (new SeedUserTable())->run();
        (new SeedGedcomTable())->run();
        (new SeedGedcomSettingTable())->run();
        (new SeedDefaultResnTable())->run();
    }
349788
public function run()
	{
		$this->echoLoadingTags();

		$assets = CoreAsset::register($this->view);

		if ($this->theme === true) { // Register the theme
			ThemeAsset::register($this->view);
		}

		if (isset($this->options['language'])) {
			$assets->language = $this->options['language'];
		}

		$assets->googleCalendar = $this->googleCalendar;
		$this->clientOptions['header'] = $this->header;

		$this->view->registerJs(implode("\n", [
			"jQuery('#{$this->options['id']}').fullCalendar({$this->getClientOptions()});",
		]), \yii\web\View::POS_READY);
	}
1060381
public function run()
    {
        if (DB::table('users')->where('username', 'admin')->first()) {
            return;
        }
        
        DB::table('users')->insert($user = [
                'username' => 'admin',
                'email' => 'admin@livecms.dev',
                'password' => bcrypt('admin'),
                'name' => 'LiveCMS Administrator',
                'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
            ]);

        $user_id = DB::table('users')->where($user)->first()->id;

        $role_id = DB::table('roles')->where('role', 'admin')->first()->id;

        DB::table('role_users')->insert(compact('role_id', 'user_id'));
    }