ldc-crm/database/factories/QuestionFactory.php

31 lines
608 B
PHP
Raw Permalink Normal View History

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 [
'question' => $this->faker->realText(40),
2021-08-10 12:09:49 +02:00
'type' => collect(QuestionType::toArray())->random()->value,
];
}
}