ldc-crm/database/factories/QuestionFactory.php
2025-07-28 09:07:54 +02:00

30 lines
612 B
PHP

<?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 [
'question' => $this->faker->realText(40),
'type' => collect(QuestionType::toArray())->random()->value,
];
}
}