30 lines
713 B
PHP
30 lines
713 B
PHP
|
<?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(),
|
||
|
];
|
||
|
}
|
||
|
}
|