Only until Jan 16th: coupon RESOLUTION25 for 40% off Yearly/Lifetime membership!

Read more here
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:

  • 69 courses (1205 lessons, 45 h 02 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord