From f736882f5e9bbb376e379245858e37aa20b61cdf Mon Sep 17 00:00:00 2001 From: bad Date: Fri, 26 Nov 2021 11:23:50 +0100 Subject: [PATCH] Display current user in header --- resources/views/layouts/app.blade.php | 7 ++++++- resources/views/login.blade.php | 2 -- routes/web.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 5e1390a..b478cec 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -12,7 +12,12 @@
diff --git a/resources/views/login.blade.php b/resources/views/login.blade.php index d485dc6..9923525 100644 --- a/resources/views/login.blade.php +++ b/resources/views/login.blade.php @@ -31,6 +31,4 @@ - - @endsection() diff --git a/routes/web.php b/routes/web.php index 94838c1..8bdca1f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -25,7 +25,7 @@ Route::get('/', [MainPageController::class, "index"])->name("main"); Route::get('/user', function () { $user = Auth::user(); return view("user", ["user"=>$user]); -})->middleware("auth"); +})->middleware("auth")->name("user"); Route::view("/login", "login");