CourseWork/database/factories/LessonFactory.php

30 lines
713 B
PHP
Raw Permalink Normal View History

2024-06-15 20:55:20 +04:00
<?php
namespace Database\Factories;
use App\Enums\TypeLesson;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Lesson>
*/
class LessonFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
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(),
];
}
}