After saving the quiz results, now we can show user how did they do in the quiz, also adding the leaderboard.
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...