Courses

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

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...

This lesson is only for Premium Members.
Want to access all lessons of this course?

You also get:

  • 68 courses (1183 lessons, 43 h 18 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord