*/ class TestimonialFactory extends Factory { protected $model = Testimonial::class; /** * @return array */ public function definition(): array { return [ 'quote' => fake()->paragraph(), 'author_name' => fake()->name(), 'context' => fake()->optional()->jobTitle(), 'photo_path' => null, 'photo_alt' => null, 'sort_order' => 0, 'is_featured' => false, 'published_at' => null, ]; } public function published(): static { return $this->state(fn (array $attributes): array => [ 'published_at' => now(), ]); } public function featured(): static { return $this->state(fn (array $attributes): array => [ 'is_featured' => true, ]); } }