*/ class LessonFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { $typeLessonCases = TypeLesson::cases(); return [ 'name' => 'Занятие' . fake()->unique()->numberBetween(), 'description' => fake()->text(200), 'type' => $typeLessonCases[array_rand($typeLessonCases)], 'lesson_date' => fake()->date(), ]; } }