php artisan db:seed --class=PostSeeder
class PostFactory extends Factory
{
protected $model = Post::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'title' => implode(' ', fake()->words),
'author' => fake()->firstName . ' ' . fake()->lastName,
'content' => fake()->realText,
];
}
}