Ejecutando
php artisan make:factory PostFactory –model=Post
y en PostFaactory.php existe un metodo definition ahí solo agregué
public function definition() { return [ 'title' => $this->faker->sentence(), 'body' => $this->faker->text($maxNbChars = 200), ];
y en la consola lo único que tuve que ejecutar fue
1) php artisan tinker
2) use App\Models\Post
3) Post::factory()->times(1)->create()