2021-08-10 12:09:49 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
|
|
use App\Enums\QuestionType;
|
|
|
|
|
use App\Models\Question;
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
|
|
class QuestionFactory extends Factory
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $model = Question::class;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Define the model's default state.
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function definition()
|
|
|
|
|
{
|
|
|
|
|
return [
|
2021-08-11 17:25:24 +02:00
|
|
|
'question' => $this->faker->realText(40),
|
2021-08-10 12:09:49 +02:00
|
|
|
'type' => collect(QuestionType::toArray())->random()->value,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|