database/seeds/AdminSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        Admin::truncate();
        factory(Admin::class, 10)->create();
        Admin::where('id', 1)->update(['username' => 'admin']);
    }
public function run ( ) { Admin :: truncate ( ) ; factory ( Admin :: class , 10 ) -> create ( ) ; Admin :: where ( 'id' , 1 ) -> update ( [ 'username' => 'admin' ] ) ; }
Run the database seeds.
Run the database seeds .
// 先清空数据表中原先数据 // 调用factory数据工厂，生成数据 生成10条数据 // 修改 id=1的记录为  用户名为admin