这样呢?
$factory->define(App\Models\Article::class, function (Faker\Generator $faker) {
$faker = Faker\Factory::create('zh_CN');
DB::table('article')->truncate();
return [
'title' => $faker->sentence,
'abstract' => $faker->sentence,
'content' => $faker->paragraph,
'image' => $faker->imageUrl(),
'created_user' => $faker->randomNumber(),
'updated_user' => $faker->randomNumber(),
'look_num' => $faker->randomNumber(),
'is_recommend' => round(rand(0,1)),
'is_show' => round(rand(0,1))
];
});
还是不行的话,你看看 faker 这个package 下面有没有对于的语言 zh_CN 的文件夹。也有可能是 这些 title 和 paragraph 没有中文。