database/seeders/UsersTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        User::factory()->count(10)->create();
        $user = User::find(1);
        $user->name = 'larbert';
        $user->email = '17835126760@163.com';
        $user->avatar = 'http://larabbs.localhost/uploads/images/avatar/202102/05/2_1612454806_AI1xqrdMHz.jpg';
        $user->save();
    }
public function run ( ) { User :: factory ( ) -> count ( 10 ) -> create ( ) ; $ user = User :: find ( 1 ) ; $ user -> name = 'larbert' ; $ user -> email = '17835126760@163.com' ; $ user -> avatar = 'http://larabbs.localhost/uploads/images/avatar/202102/05/2_1612454806_AI1xqrdMHz.jpg' ; $ user -> save ( ) ; }
Run the database seeds.
Run the database seeds .
// 生成数据集合 // 单独处理第一个用户的数据