Run the database seeds.

@return void
434651
public function run()
    {
        DB::table('users')->insert([
            ['id' => '1', 'email' => 'webmaster@chilcanoweb.com', 'password' => bcrypt('admin'), 'estado' => '1']
        ]);

        DB::table('user_profiles')->insert([
            [
                'id' => '1',
                'user_id' => '1',
                'nombres' => 'Administrador',
                'apellidos' => 'ChilcanoWeb',
                'descripcion' => 'Administrador',
                'imagen' => 'admin.png',
                'imagen_carpeta' => 'carpeta/'
            ]
        ]);

        //AJUSTES
        DB::table('configuracion')->insert([
            ['tipo' => 'admin', 'nombre' => 'logo', 'etiqueta' => 'Logo', 'valor' => 'logo-admin.png', 'contenido' => '{"imagen_carpeta": "carpeta/"}'],

	        ['tipo' => 'redes-sociales', 'nombre' => 'facebook', 'etiqueta' => 'Facebook', 'valor' => 'https://www.facebook.com/', 'contenido' => '{"icono": "socicon-facebook", "color": "#3e5b98"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'google', 'etiqueta' => 'Google+', 'valor' => '', 'contenido' => '{"icono": "socicon-googleplus", "color": "#dd4b39"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'instagram', 'etiqueta' => 'Instagram', 'valor' => '', 'contenido' => '{"icono": "socicon-instagram", "color": "#000000"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'linkedin', 'etiqueta' => 'Linkedin', 'valor' => 'https://www.linkedin.com/', 'contenido' => '{"icono": "socicon-linkedin", "color": "#3371b7"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'pinterest', 'etiqueta' => 'Pinterest', 'valor' => '', 'contenido' => '{"icono": "socicon-pinterest", "color": "#c92619"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'skype', 'etiqueta' => 'Skype', 'valor' => '', 'contenido' => '{"icono": "socicon-skype", "color": "#28abe3"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'tumblr', 'etiqueta' => 'Tumblr', 'valor' => '', 'contenido' => '{"icono": "socicon-tumblr", "color": "#45556c"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'twitter', 'etiqueta' => 'Twitter', 'valor' => '', 'contenido' => '{"icono": "socicon-twitter", "color": "#4da7de"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'vimeo', 'etiqueta' => 'Vimeo', 'valor' => '', 'contenido' => '{"icono": "socicon-vimeo", "color": "#51b5e7"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'youtube', 'etiqueta' => 'Youtube', 'valor' => '', 'contenido' => '{"icono": "socicon-youtube", "color": "#e02a20"}'],

            ['tipo' => 'web', 'nombre' => 'titulo', 'etiqueta' => 'Titulo', 'valor' => 'Empresa', 'contenido' => ''],
            ['tipo' => 'web', 'nombre' => 'dominio', 'etiqueta' => 'Dominio', 'valor' => 'http://empresa.dev/', 'contenido' => ''],
            ['tipo' => 'web', 'nombre' => 'logo', 'etiqueta' => 'Logo', 'valor' => 'logo.png', 'contenido' => '{"imagen_carpeta": "carpeta/"}'],
            ['tipo' => 'web', 'nombre' => 'keywords', 'etiqueta' => 'Palabras clave', 'valor' => '', 'contenido' => ''],
            ['tipo' => 'web', 'nombre' => 'description', 'etiqueta' => 'Descripción', 'valor' => '', 'contenido' => ''],
            ['tipo' => 'web', 'nombre' => 'google-analytics', 'etiqueta' => 'Google Analytics', 'valor' => '', 'contenido' => ''],

            ['tipo' => 'footer', 'nombre' => 'direccion', 'etiqueta' => 'Dirección', 'valor' => 'Av. Mi Empresa 123 - Lima, Perú', 'contenido' => ''],
            ['tipo' => 'footer', 'nombre' => 'datos', 'etiqueta' => 'Datos', 'valor' => '+51999888777 | 123-4567', 'contenido' => ''],

            ['tipo' => 'contacto', 'nombre' => 'titulo', 'etiqueta' => 'Titulo', 'valor' => 'Contacto', 'contenido' => ''],
            ['tipo' => 'contacto', 'nombre' => 'descripcion', 'etiqueta' => 'Descripcion', 'valor' => 'Duis aute irure dolor in reprehenderit in', 'contenido' => ''],
            ['tipo' => 'contacto', 'nombre' => 'mensaje-enviado', 'etiqueta' => 'Mensaje de Éxito', 'valor' => 'Tu mensaje fue enviado con éxito', 'contenido' => ''],
        ]);
    }
451321
public function run()
    {
        $groups = $this->groups ?: $this->groups();
        DB::table('group_permissions')->truncate();

        foreach ($groups as $group) {
            $permissions = $group['permissions'] ?? [];
            unset($group['permissions']);

            /** @var Group $groupModel */
            $groupModel = Group::firstOrCreate($group);

            foreach ($permissions as $permission) {
                $groupModel->grantPermissions(Permission::firstOrCreate($permission));
            }
        }
    }
616704
public function run()
    {
        //
        DB::table('districts')->insert([
            'name' => 'Bawku Municipal',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Bawku West',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Binduri',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Bolgatanga Municipal',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Bongo',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Builsa North',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Builsa South',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Garu-Tempane',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Kassena-Nankana',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Kassena Nankana West',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Nabdam',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Pusiga District',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Talensi',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Bolgatanga East District',
            'region_id' => 8
        ]);
        DB::table('districts')->insert([
            'name' => 'Tempane District',
            'region_id' => 8
        ]);
        
    }
147488
public function run()
    {
        $sqlite = in_array(config('database.default'), ['sqlite', 'testing'], true);

        if (! $sqlite) {
            DB::statement('SET FOREIGN_KEY_CHECKS=0');
        }

        if (is_50() or is_51()) {
            Eloquent::unguard();
        }

        $faker = Faker::create();

        // Seeding authors table
        Author::truncate();

        foreach (range(1, 10) as $index) {
            Author::create([
                'name' => $faker->userName,
                'email' => $faker->safeEmail,
            ]);
        }

        $this->command->line("<info>Seeded:</info> authors table");

        // Seeding resources table
        Book::truncate();

        $authorIds = (is_50())
            ? Author::pluck('id')
            : Author::pluck('id')->toArray();

        foreach (range(1, 100) as $index) {
            Book::create([
                'title' => $faker->sentence(),
                'author_id' => $faker->randomElement($authorIds),
                'published_at' => $faker->dateTimeThisCentury,
                'description' => $faker->randomElement([$faker->paragraph(), null]),
                'out_of_print' => $faker->randomElement([true, false]),
                'created_at' => $faker->dateTimeThisYear,
            ]);
        }

        if (is_50() or is_51()) {
            Eloquent::regard();
        }

        if (! $sqlite) {
            DB::statement('SET FOREIGN_KEY_CHECKS=1');
        }

        $this->command->line("<info>Seeded:</info> books table");
    }
696670
public function run()
    {
        $this->seed('DataTypesTableSeeder');
        $this->seed('DataRowsTableSeeder');
        $this->seed('MenusTableSeeder');
        $this->seed('MenuItemsTableSeeder');
        $this->seed('RolesTableSeeder');
        $this->seed('PermissionsTableSeeder');
        $this->seed('PermissionRoleTableSeeder');
        //测试数据
        $this->seed('CategoriesTableSeeder');
        $this->seed('UsersTableSeeder');
        $this->seed('PostsTableSeeder');
        $this->seed('PagesTableSeeder');
        $this->seed('SettingsTableSeeder');
        $this->seed('TranslationsTableSeeder');
    }
901870
public function run()
    {
        $this->call(__NAMESPACE__.'\\OptionsTableSeeder');
        $this->call(__NAMESPACE__.'\\RolesTableSeeder');
        $this->call(__NAMESPACE__.'\\PermissionsTableSeeder');
        $this->call(__NAMESPACE__.'\\UsersTableSeeder');
        $this->call(__NAMESPACE__.'\\CategoriesTableSeeder');
    }
974237
public function run()
    {
        Model::unguard();

        DB::table('user__users')->delete();
        DB::table('user__roles')->delete();
        DB::table('user__password_resets')->delete();
        DB::table('user__role_user')->delete();
        DB::table('user__permissions')->delete();
        DB::table('user__permission_role')->delete();

        $this->createAdmin();
        $this->createDemo();

        $this->createUsers();
    }
414105
public function run()
    {
        /*
         * Role Types
         *
         */
        $RoleItems = [
            [
                'name'        => 'Admin',
                'slug'        => 'admin',
                'description' => 'Admin Role',
                'level'       => 5,
            ],
            [
                'name'        => 'User',
                'slug'        => 'user',
                'description' => 'User Role',
                'level'       => 1,
            ],
            [
                'name'        => 'Unverified',
                'slug'        => 'unverified',
                'description' => 'Unverified Role',
                'level'       => 0,
            ],
        ];

        /*
         * Add Role Items
         *
         */
        echo "\e[32mSeeding:\e[0m DefaultRoleItemsTableSeeder\r\n";
        foreach ($RoleItems as $RoleItem) {
            $newRoleItem = config('roles.models.role')::where('slug', '=', $RoleItem['slug'])->first();
            if ($newRoleItem === null) {
                $newRoleItem = config('roles.models.role')::create([
                    'name'          => $RoleItem['name'],
                    'slug'          => $RoleItem['slug'],
                    'description'   => $RoleItem['description'],
                    'level'         => $RoleItem['level'],
                ]);
                echo "\e[32mSeeding:\e[0m DefaultRoleItemsTableSeeder - Role:".$RoleItem['slug']."\r\n";
            }
        }
    }
645201
public function run()
    {
        Model::unguard();

        DB::table('core__media')->delete();
        DB::table('core__activities')->delete();

        $this->clearStoredMedia();
    }
1227440
public function run()
    {
        $old = explode(' ', $this->parameters['previous']);
        $new = explode(' ', $this->parameters['current']);
        $out = $this->parameters['output'];
        
        $diff = new taoDevTools_models_RdfDiff();
        foreach ($old as $file) {
            $diff->removeRdf($file);
        }
        foreach ($new as $file) {
            $diff->addRdf($file);
        }
        file_put_contents($out, $diff->exportDiffToSql());
    }
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);
	}
768153
private function runMigration()
    {
        // Confirm connection and migration.
        $connection = $this->confirmConnectionAndMigration();

        // Load the migration class.
        $migration_class = $this->getMigrationClass();

        // Process the migration.
        $this->processMigration($connection, $migration_class);

        // Save this migration to the database/migrations folder.
        $this->createMigrationFile($connection, $migration_class);
    }
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'));
    }
1288597
public function run()
    {
        DB::table('languages')->delete();

        foreach ($this->langs() as $lang) {
            Language::create($lang);
        }
    }
982609
public function run()
    {
        Model::unguard();

        $this->call('Modules\User\Database\Seeders\PermissionPermissionTableSeeder');
        $this->call('Modules\User\Database\Seeders\RolePermissionTableSeeder');
        $this->call('Modules\User\Database\Seeders\UserPermissionTableSeeder');

        $this->call('Modules\User\Database\Seeders\RoleTableSeeder');
    }
775410
final protected function runDatabaseMigrationsAndSeeders()
    {
        // Ask to migrate the database,
        // if we've copied any migration files to the application.
        if (!empty($this->migrations) && $this->getCommand()->confirm('Do you wish to migrate your database?', true)) {
            try {
                $this->getCommand()->call('migrate');
            } catch (Exception $e) {
                $this->getCommand()->error(sprintf('Could not migrate your database. Reason: %s', $e->getMessage()));
            }
        }

        // Before we ask user to seed the database
        // we need to have look in the $seeders array
        // to remove folders from the array
        $seeders = [];
        foreach ($this->seeders as $seeder) {
            if (is_dir(base_path($seeder))) {
                continue;
            }
            $seeders[] = $seeder;
        }

        // Ask to seed the database,
        // if we've copied any migration files to the application.
        if (!empty($seeders) && $this->getCommand()->confirm('Do you wish to seed your database?', true)) {
            // Load seeders directory so new seeders are available
            load_directory($this->getInstaller()->getBasePath('database/seeds/'));

            // Run package seeders
            foreach ($seeders as $seeder) {
                try {
                    $seederFilename = substr($seeder, strrpos($seeder, '/') + 1);
                    $this->getCommand()->call('db:seed', [
                        '--class' => substr($seederFilename, 0, strrpos($seederFilename, '.')),
                    ]);
                } catch (Exception $e) {
                    $this->getCommand()->error(sprintf('Could not seed database. Reason: %s', $e->getMessage()));
                }
            }
        }
    }
229995
public function _run()
	{
		echo $this->_engine->get(
			$this->getTemplateFile(func_get_arg(0)),
			$this->getDataProvider(),
			$this->getCompiler()
		);
	}