User::factory(), 'text' => $this->faker->text(100), 'answerer_id' => $this->faker->optional()->passthrough(User::factory()), 'answer' => function (array $attributes) { return $attributes['answerer_id'] ? $this->faker->text() : null; }, 'answered_at' => function (array $attributes) { return $attributes['answerer_id'] ? Carbon::instance($this->faker->dateTimeThisMonth()) : null; }, ]; } }