Courses

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

Showing Quiz/Test Result

After saving the quiz results, now we can show user how did they do in the quiz, also adding the leaderboard.

leaderbord

First, we need a controller and a route for that.

php artisan make:controller ResultController

routes/web.php:

Route::get('/', [HomeController::class, 'index'])->name('home');
Route::get('quiz/{quiz}/{slug?}', [HomeController::class, 'show'])->name('quiz.show');
Route::get('results/{test}', [ResultController::class, 'show'])->name('results.show');
// ...

And now after creating the test we can redirect to this page...

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