mirror of
https://github.com/10h30/Test-Laravel-Auth-Basics.git
synced 2026-07-11 10:46:16 +09:00
COmplete task 3
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
|||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Laravel\Sanctum\HasApiTokens;
|
use Laravel\Sanctum\HasApiTokens;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable implements MustVerifyEmail
|
||||||
{
|
{
|
||||||
use HasApiTokens, HasFactory, Notifiable;
|
use HasApiTokens, HasFactory, Notifiable;
|
||||||
|
|
||||||
|
|||||||
Generated
+1460
-1153
File diff suppressed because it is too large
Load Diff
+8
-2
@@ -20,17 +20,23 @@ Route::get('/', function () {
|
|||||||
Route::get('users', [\App\Http\Controllers\UserController::class, 'index'])->name('users.index');
|
Route::get('users', [\App\Http\Controllers\UserController::class, 'index'])->name('users.index');
|
||||||
|
|
||||||
// Task: profile functionality should be available only for logged-in users
|
// Task: profile functionality should be available only for logged-in users
|
||||||
Route::get('profile', [\App\Http\Controllers\ProfileController::class, 'show'])->name('profile.show');
|
Route::get('profile', [\App\Http\Controllers\ProfileController::class, 'show'])
|
||||||
Route::put('profile', [\App\Http\Controllers\ProfileController::class, 'update'])->name('profile.update');
|
->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
|
// 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
|
// Add some middleware here, and change some code in app/Models/User.php to enable this
|
||||||
Route::view('/secretpage', 'secretpage')
|
Route::view('/secretpage', 'secretpage')
|
||||||
|
->middleware(['auth', 'verified'])
|
||||||
->name('secretpage');
|
->name('secretpage');
|
||||||
|
|
||||||
// Task: this "/verysecretpage" URL should ask user for verifying their password once again
|
// Task: this "/verysecretpage" URL should ask user for verifying their password once again
|
||||||
// You need to add some middleware here
|
// You need to add some middleware here
|
||||||
Route::view('/verysecretpage', 'verysecretpage')
|
Route::view('/verysecretpage', 'verysecretpage')
|
||||||
|
->middleware(['auth', 'verified', 'password.confirm'])
|
||||||
->name('verysecretpage');
|
->name('verysecretpage');
|
||||||
|
|
||||||
require __DIR__.'/auth.php';
|
require __DIR__.'/auth.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user