QuestionFactory.php 584 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\Question;
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. class QuestionFactory extends Factory
  6. {
  7. protected $model = Question::class;
  8. public function definition(): array
  9. {
  10. return [
  11. 'question_code' => 'Q-' . $this->faker->unique()->numerify('######'),
  12. 'question_type' => 'answer',
  13. 'stem' => $this->faker->sentence(),
  14. 'answer' => $this->faker->sentence(),
  15. 'solution' => $this->faker->paragraph(),
  16. 'difficulty' => 1,
  17. ];
  18. }
  19. }