From b8bc23ee1f26c1e50f116b97a5f1a196dae7d89c Mon Sep 17 00:00:00 2001 From: Bayu Lukman Yusuf Date: Mon, 19 Jan 2026 09:07:01 +0700 Subject: [PATCH] profile page --- .../Controllers/Auth/LoginEmailController.php | 2 + .../Controllers/Auth/ProfileController.php | 17 ++++++++ resources/views/account/info.blade.php | 39 ++++++++----------- .../views/components/layout/header.blade.php | 2 +- .../partials/account-sidebar.blade.php | 39 +++++++++++-------- .../views/layouts/partials/navbar.blade.php | 23 ++--------- routes/web.php | 3 ++ 7 files changed, 66 insertions(+), 59 deletions(-) create mode 100644 app/Http/Controllers/Auth/ProfileController.php diff --git a/app/Http/Controllers/Auth/LoginEmailController.php b/app/Http/Controllers/Auth/LoginEmailController.php index 92b8ed3..fca4dae 100644 --- a/app/Http/Controllers/Auth/LoginEmailController.php +++ b/app/Http/Controllers/Auth/LoginEmailController.php @@ -120,6 +120,8 @@ class LoginEmailController extends Controller 'device' => 'web', ]); + + return redirect()->route('home')->with('success', __('otp.login_success')); } catch (\Illuminate\Validation\ValidationException $e) { diff --git a/app/Http/Controllers/Auth/ProfileController.php b/app/Http/Controllers/Auth/ProfileController.php new file mode 100644 index 0000000..eaf7f4b --- /dev/null +++ b/app/Http/Controllers/Auth/ProfileController.php @@ -0,0 +1,17 @@ +check()) { + return redirect()->route('login'); + } + return view('account.info'); + } +} diff --git a/resources/views/account/info.blade.php b/resources/views/account/info.blade.php index 93d2bbb..f87b29e 100644 --- a/resources/views/account/info.blade.php +++ b/resources/views/account/info.blade.php @@ -16,40 +16,35 @@
- +
- +
Please enter your first name!
-
- -
- -
Please enter your last name!
-
-
+
user()->birth_date)) : '' }}" }' id="birthdate" placeholder="Choose date" type="text" />
-
+ {{--
-
+
--}}
@@ -104,8 +99,8 @@
    -
  • susan.gardner@email.com
  • -
  • +1 (805) 348 95 72 Verified
  • +
  • {{ auth()->user()->email }}
  • +
  • {{ auth()->user()->phone ?? 'Not Set' }}Verified
@@ -114,7 +109,7 @@
+ value="{{ auth()->user()->email ?? 'Not Set' }}" />
Please enter a valid email address!
@@ -122,9 +117,9 @@
+ data-input-format='{"numericOnly": true, "delimiters": ["", " "], "blocks": [0, 3, 0, 3, 0,3,0,3,0,3]}' + id="phone" placeholder="" required="" type="text" + value="{{ auth()->user()->phone ?? 'Not Set' }}" />
Please enter your phone number!
diff --git a/resources/views/components/layout/header.blade.php b/resources/views/components/layout/header.blade.php index 385c642..f7f8d55 100644 --- a/resources/views/components/layout/header.blade.php +++ b/resources/views/components/layout/header.blade.php @@ -235,7 +235,7 @@ + href="{{ auth()->check() ? route('profile') : route('login') }}"> {{ __('header.account') }} diff --git a/resources/views/layouts/partials/account-sidebar.blade.php b/resources/views/layouts/partials/account-sidebar.blade.php index 60a12a5..89b0c26 100644 --- a/resources/views/layouts/partials/account-sidebar.blade.php +++ b/resources/views/layouts/partials/account-sidebar.blade.php @@ -6,12 +6,12 @@
S
+ style="width: 3rem; height: 3rem">{{ auth()->user()->name ? substr(auth()->user()->name, 0, 1) : 'S' }}
@@ -33,21 +35,24 @@
@endif diff --git a/routes/web.php b/routes/web.php index fad6306..3c915f4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -11,6 +11,7 @@ use App\Http\Controllers\LocaleController; use App\Http\Controllers\ProductController; use App\Http\Controllers\SearchController; use App\Http\Controllers\ComponentController; +use App\Http\Controllers\Auth\ProfileController; Route::group(['prefix' => '/dummy'], function () { Route::get('', [RoutingController::class, 'index'])->name('root'); @@ -67,3 +68,5 @@ Route::group(['prefix' => '/login/google'], function () { Route::get('/callback', [App\Http\Controllers\Auth\GoogleController::class, 'handleGoogleCallback'])->name('login.google.callback'); }); +Route::get('/profile', [ProfileController::class, 'index'])->name('profile'); +