mirror of
https://github.com/10h30/Test-Laravel-Auth-Basics.git
synced 2026-06-05 15:07:43 +09:00
43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
*/
|
|
|
|
Route::get('/', function () {
|
|
return view('home');
|
|
})->name('home');
|
|
|
|
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'])
|
|
->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';
|