*/ class AnnouncementFactory extends Factory { protected $model = Announcement::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'content' => $this->faker->paragraphs(2, true), ]; } /** * Indicate that the announcement is important. */ public function important(): static { return $this->state(fn (array $attributes) => [ 'content' => 'PENTING: '.$this->faker->sentence(10), ]); } /** * Indicate that the announcement is informational. */ public function informational(): static { return $this->state(fn (array $attributes) => [ 'content' => 'INFORMASI: '.$this->faker->paragraph(), ]); } }