@extends('app') @section('content')
{{-- Page Header --}} {{-- Breadcrumb --}} {{-- Alerts --}} @if (session('success'))
Berhasil! {{ session('success') }}
@endif @if (session('error'))
Gagal! {{ session('error') }}
@endif
{{-- LEFT: Avatar & info ringkas --}}
{{-- Profile Card --}}
{{-- Avatar --}}
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
{{-- Name & Role --}}

{{ Auth::user()->name }}

{{ Auth::user()->email }}
@if (Auth::user()->role === 'admin') Admin @else Pembeli @endif

{{-- Stats --}}
{{ Auth::user()->pemesanan->count() }}
Total Pesanan
{{ Auth::user()->pemesanan->where('status', 'selesai')->count() }}
Selesai
{{-- Info Akun --}}
Informasi Akun
Bergabung {{ Auth::user()->created_at->format('d M Y') }}
Diperbarui {{ Auth::user()->updated_at->format('d M Y') }}
Alamat {{ Auth::user()->alamat ?? '-' }}
{{-- RIGHT: Forms --}}
{{-- Form: Edit Profil --}}
Edit Informasi Profil
@if ($errors->hasBag('updateProfile'))
Kesalahan:
    @foreach ($errors->getBag('updateProfile')->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf @method('PATCH')
@error('name', 'updateProfile')
{{ $message }}
@enderror
@error('email', 'updateProfile')
{{ $message }}
@enderror
@error('alamat', 'updateProfile')
{{ $message }}
@enderror

{{-- Form: Ganti Password --}}
Ganti Password
@if ($errors->hasBag('updatePassword'))
Kesalahan:
    @foreach ($errors->getBag('updatePassword')->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf @method('PATCH')
@error('current_password', 'updatePassword')
{{ $message }}
@enderror
@error('password', 'updatePassword')
{{ $message }}
@enderror
Password baru minimal 8 karakter. Gunakan kombinasi huruf, angka, dan simbol untuk keamanan lebih baik.

@endsection