Courses

Creating a Quiz System with Laravel 10 + Livewire 3: Step-by-Step

Questions Test

In the next lessons, we will use built-in Livewire testing tools to test Livewire components.

questions tests

The first one will be for the Questions, so first we need the Question factory.

php artisan make:factory QuestionFactory

database/factories/QuestionFactory.php:

class QuestionFactory extends Factory
{
public function definition(): array
{
return [
'question_text' => fake()->paragraph(),
];
}
}

Because Questions needs an option we need to create a factory for the QuestionOption Model...

The full lesson is only for Premium Members.
Want to access all 18 lessons of this course? (81 min read)

You also get:

  • 69 courses (majority in latest Laravel 11)
  • Premium tutorials
  • Access to repositories
  • Private Discord