*/ class PostFactory extends Factory { protected $model = Post::class; public function definition(): array { $title = $this->faker->unique()->sentence(6); return [ 'post_category_id' => PostCategory::factory(), 'title' => $title, 'slug' => Str::slug($title), 'excerpt' => $this->faker->sentence(), 'content' => '
' . implode('
', $this->faker->paragraphs(4)) . '
', 'thumbnail' => null, 'status' => $this->faker->randomElement(['draft', 'published', 'hidden']), 'is_featured' => $this->faker->boolean(20), 'view_count' => $this->faker->numberBetween(0, 3000), 'reading_time' => $this->faker->numberBetween(2, 12), 'meta_title' => $title, 'meta_description' => $this->faker->sentence(), 'published_at' => now(), ]; } }