COmplete task 3

This commit is contained in:
Thuan Bui
2025-04-03 18:41:41 +09:00
parent f0cc8fb909
commit 3bcc26e91f
3 changed files with 1469 additions and 1156 deletions
+8 -2
View File
@@ -20,17 +20,23 @@ Route::get('/', function () {
Route::get('users', [\App\Http\Controllers\UserController::class, 'index'])->name('users.index');
// Task: profile functionality should be available only for logged-in users
Route::get('profile', [\App\Http\Controllers\ProfileController::class, 'show'])->name('profile.show');
Route::put('profile', [\App\Http\Controllers\ProfileController::class, 'update'])->name('profile.update');
Route::get('profile', [\App\Http\Controllers\ProfileController::class, 'show'])
->middleware('auth')
->name('profile.show');
Route::put('profile', [\App\Http\Controllers\ProfileController::class, 'update'])
->middleware('auth')
->name('profile.update');
// Task: this "/secretpage" URL should be visible only for those who VERIFIED their email
// Add some middleware here, and change some code in app/Models/User.php to enable this
Route::view('/secretpage', 'secretpage')
->middleware(['auth', 'verified'])
->name('secretpage');
// Task: this "/verysecretpage" URL should ask user for verifying their password once again
// You need to add some middleware here
Route::view('/verysecretpage', 'verysecretpage')
->middleware(['auth', 'verified', 'password.confirm'])
->name('verysecretpage');
require __DIR__.'/auth.php';