Courses

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

Quizzes Test

In this last lesson, we will have another test for Quizzes form.

As always we need a factory.

php artisan make:factory QuizFactory

database/factories/QuizFactory.php:

use Illuminate\Support\Str;
 
class QuizFactory extends Factory
{
public function definition(): array
{
$title = $this->faker->sentence();
$slug = Str::slug($title);
 
return [
'title' => $title,
'slug' => $slug,
'description' => fake()->paragraph(),
'published' => false,
'public' => false,
];
}
}

And the feature test...

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