Run the database seeding.

@return void
356209
public function run()
    {
        DB::table('posts')->delete();

        $post = array(
            'title'      => 'Hello World',
            'summary'    => 'This is the first blog post.',
            'body'       => 'This is an example blog post.',
            'user_id'    => 1,
            'created_at' => new DateTime,
            'updated_at' => new DateTime
        );

        DB::table('posts')->insert($post);
    }
109713
public function run()
    {

         //Get The Models To put In Database
        $models = collect([
                    'Post' => Post::class,
                    'Tag' => Tag::class,
                    'Category' => Category::class
                     ]);

        //Each Model Got His Attribues
        $columns = collect([
               'Post' => [
                    'title' => [
                        'required|max:150',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|unique:posts,slug',
                        'text',
                        true,
                        null
                    ],
                    'content' => [
                        'required',
                        'rich_text_box',
                        false,
                        null
                    ],
                    'description' => [
                        'required|max:250',
                        'text_area',
                        false,
                        null
                    ],
                    'featured' => [
                        null,
                        'checkbox',
                        false,
                        null
                    ],
                    'tags' => [
                        null,
                        'tags',
                        false,
                        null
                    ],
                    'category' => [
                        'required',
                        'category',
                        false,
                        null
                    ],
                    'image' => [
                        'required|mimes:jpeg,bmp,png',
                        'image',
                        true,
                        null
                    ],
                    'status' => [
                        null,
                        'status',
                        true,
                        [
                            [
                                'value' => 'PUBLISHED',
                                'option' => 'PUBLISHED'
                            ],
                            [
                                'value' => 'PENDING',
                                'option' => 'PENDING'
                            ],
                            [
                                'value' => 'DRAFT',
                                'option' => 'DRAFT'
                            ]
                        ],
                    ]
                ],
               'Tag' => [
                    'name' => [
                        'required|max:156',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|max:100|unique:tags,slug',
                        'string',
                        true,
                        null
                    ]
                ],
               'Category' => [
                    'name' => [
                        'required|max:156',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|max:100|unique:categories,slug',
                        'string',
                        true,
                        null
                    ]
                ]
               ]);
      $settings = collect([
        'title' => [
            'Site Title',
            'text'
        ],
        'description' => [
            'Site Description',
            'text'
        ],
        'logo' => [
            'Site Logo',
            'image'
        ],
        'google_analytics_client_id' => [
            'Google Api Id',
            'text'
        ]
      ]);


        $this->command->info('Laramin Data Seeder');

        $this->command->info('Seed Settings');
        $settings->each(function($value,$index) {
            $this->command->info('Creating Settings for '.$index);
            Settings::create([
                    'key' => $index,
                    'display_name' => $value[0],
                    'type' => $value[1],
            ]);
        });


        $models->each(function ($model, $index) use ($columns) {
            $this->command->info('Creating Data Type to '.$index);

            $res = DataType::create([
                        'name' => $index,
                        'menu' => true,
                        'model' =>  $index,
                        'slug' => strtolower($index),
                    ]);
            $id = $res->id;
            $columns->filter(function ($item, $key) use ($index, $id) {
                return $key == $index;
            })->Flatmap(function ($item, $key) use ($id) {
                return $item;
            })->each(function ($item, $key) use ($id) {
                $this->command->info('Creating Data Info '.$key.' for '.DataType::find($id)->name);

                DataInfo::create([
                        'data_types_id' => $id,
                        'column' => $key,
                        'type' => $item[1],
                        'validation' => $item[0] == null ? NULL : json_encode($item[0]),
                        'details' => $item[3] == null ? NULL : json_encode($item[3]),
                        'display' => $item[2]
                    ]);
            });
        });
    }
963778
public function run()
    {
        $defaults = [];

        $defaults = $this->cleanupAndMerge($this->getDefaults(), $this->config);

        foreach ($defaults as $slug => $column) {
            $setting = Setting::bySlug($slug);

            if ($setting->count()) {
                $setting->first()->update([
                    'default' => $column,
                ]);
            } else {
                Setting::create([
                    'lang'    => null,
                    'slug'    => $slug,
                    'value'   => $column,
                    'default' => $column,
                ]);
            }
        }
    }
1253428
public function run()
    {
        $userRole = config('roles.models.role')::where('name', '=', 'User')->first();
        $adminRole = config('roles.models.role')::where('name', '=', 'Admin')->first();
        $permissions = config('roles.models.permission')::all();

        /*
         * Add Users
         *
         */
        if (config('roles.defaultUserModel')::where('email', '=', 'admin@admin.com')->first() === null) {
            $newUser = config('roles.defaultUserModel')::create([
                'name'     => 'Admin',
                'email'    => 'admin@admin.com',
                'password' => bcrypt('password'),
            ]);

            $newUser->attachRole($adminRole);
            foreach ($permissions as $permission) {
                $newUser->attachPermission($permission);
            }
        }

        if (config('roles.defaultUserModel')::where('email', '=', 'user@user.com')->first() === null) {
            $newUser = config('roles.defaultUserModel')::create([
                'name'     => 'User',
                'email'    => 'user@user.com',
                'password' => bcrypt('password'),
            ]);

            $newUser;
            $newUser->attachRole($userRole);
        }
    }
1348880
static public function run()
  {
    foreach (self::$dbs as $db) {
      $db->execute(self::files());
    }

    foreach (self::$writers as $writer) {
      $writer->execute(self::files());
    }
  }
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');
    }
425562
public function run(): void
    {
        $continents = json_decode(file_get_contents(__DIR__ . '/../../resources/json/continents.json'), true);

        foreach ($continents as $continent) {

            $this->connection->beginTransaction();

            try {
                $translations = $continent['translations'];
                array_forget($continent, 'translations');

                $continentRecord = $this->continentRepository->updateOrCreate(['id' => $continent['id']], $continent);
                $continentRecord->updateTranslations($translations);

                $this->connection->commit();

            } catch (\Exception $e) {
                $this->connection->rollBack();
                dd($e);
            }
        }
    }
1132141
public function run()
    {
        $this->call(UsersTableSeeder::class);
        $this->call(EmailsTableSeeder::class);
        $this->call(FormsTableSeeder::class);
    }
697925
public function run()
    {
        Model::unguard();
        try {
            foreach ($this->seederClasses as $seederClass) {
                $this->parentSeeder->call($seederClass);
            }
        } finally {
            Model::reguard();
        }
    }
831605
public function run()
    {
        $this->command->info('Truncating User, Role and Permission tables');
        $this->truncateLaratrustTables();

        $config = config('laratrust_seeder.role_structure');
        $userPermission = config('laratrust_seeder.permission_structure');
        $mapPermission = collect(config('laratrust_seeder.permissions_map'));

        foreach ($config as $key => $modules) {
            // Create a new role
            $role = \Simoja\Laramin\Models\Role::create([
                'name' => $key,
                'display_name' => ucwords(str_replace("_", " ", $key)),
                'description' => ucwords(str_replace("_", " ", $key))
            ]);

            $this->command->info('Creating Role '. strtoupper($key));

            // Reading role permission modules
            foreach ($modules as $module => $value) {
                $permissions = explode(',', $value);

                foreach ($permissions as $p => $perm) {
                    $permissionValue = $mapPermission->get($perm);

                    $permission = \Simoja\Laramin\Models\Permission::firstOrCreate([
                        'name' => $permissionValue . '-' . $module,
                        'display_name' => ucfirst($permissionValue) . ' ' . ucfirst($module),
                        'description' => ucfirst($permissionValue) . ' ' . ucfirst($module),
                    ]);

                    $this->command->info('Creating Permission to '.$permissionValue.' for '. $module);

                    if (!$role->hasPermission($permission->name)) {
                        $role->attachPermission($permission);
                    } else {
                        $this->command->info($key . ': ' . $p . ' ' . $permissionValue . ' already exist');
                    }
                }
            }

            $this->command->info("Creating '{$key}' user");
            // Create default user for each role
            $user = \App\User::create([
                'name' => ucwords(str_replace("_", " ", $key)),
                'email' => $key.'@app.com',
                'password' => bcrypt('password')
            ]);
            $user->attachRole($role);
        }

        // creating user with permissions
        if (!empty($userPermission)) {
            foreach ($userPermission as $key => $modules) {
                foreach ($modules as $module => $value) {
                    $permissions = explode(',', $value);
                    // Create default user for each permission set
                    $user = \App\User::create([
                        'name' => ucwords(str_replace("_", " ", $key)),
                        'email' => $key.'@app.com',
                        'password' => bcrypt('password'),
                        'remember_token' => str_random(10),
                    ]);
                    foreach ($permissions as $p => $perm) {
                        $permissionValue = $mapPermission->get($perm);

                        $permission = \Simoja\Laramin\Models\Permission::firstOrCreate([
                            'name' => $permissionValue . '-' . $module,
                            'display_name' => ucfirst($permissionValue) . ' ' . ucfirst($module),
                            'description' => ucfirst($permissionValue) . ' ' . ucfirst($module),
                        ]);

                        $this->command->info('Creating Permission to '.$permissionValue.' for '. $module);

                        if (!$user->hasPermission($permission->name)) {
                            $user->attachPermission($permission);
                        } else {
                            $this->command->info($key . ': ' . $p . ' ' . $permissionValue . ' already exist');
                        }
                    }
                }
            }
        }
    }
685565
protected function setupSeeds()
    {
        $seeds = realpath(__DIR__.'/../database/seeds');

        $this->publishes([
            $seeds    => $this->app->databasePath() . '/seeds',
        ]);
    }
1334707
public function run()
    {
        session_start();
        self::$_app = $this;
        if (empty($this->_runtimePath)) {
            $this->_runtimePath = $this->_basePath . '/runtime';
        }
        $application = $this->getComponent('application');
        $application->runController();
    }
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));
    }
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);
    }
905358
public function run()
    {
        if (User::count() == 0) {
            $role = Role::where('name', 'admin')->firstOrFail();

            User::create([
                'name'           => 'Admin',
                'email'          => 'admin@admin.com',
                'password'       => bcrypt('password'),
                'remember_token' => str_random(60),
                'role_id'        => $role->id,
            ]);
        }
    }
1145031
public function run()
    {
        $this->generateModel();
        $this->generateMigration();
        $this->generateSeed();
        $this->generateRequest();
        $this->generateController();
        $this->runMigration();
        $this->generateViews();
        $this->appendRoute();
    }
160259
public function run() {
		$this->load_hooks();

		// Need to ensure these classes are activated here for hooks to fire.
		if ( $this->is_current_page( [ 'options.php', 'options-general.php', 'settings.php' ] ) ) {
			Singleton::get_instance( 'Install', $this )->run();
			Singleton::get_instance( 'Remote_Management', $this )->load_hooks();
		}
	}