@extends('admin.layouts.app') @section('title', '관리자 정보 수정') @section('page_title', '관리자 정보 수정') @section('page_desc', '기본정보/상태/2FA/역할을 관리합니다.') @push('head') @endpush @section('content') @php $ip = !empty($admin->last_login_ip) ? inet_ntop($admin->last_login_ip) : '-'; $lockedUntil = $admin->locked_until ?? null; $isLocked = false; if (!empty($lockedUntil)) { try { $isLocked = \Carbon\Carbon::parse($lockedUntil)->isFuture(); } catch (\Throwable $e) { $isLocked = true; } } $st = (string)($admin->status ?? 'active'); $statusLabel = $st === 'active' ? '활성' : '비활성'; $statusPill = $st === 'active' ? 'pill--ok' : 'pill--bad'; $hasSecret = !empty($admin->totp_secret_enc); $isModeOtp = (int)($admin->totp_enabled ?? 0) === 1; @endphp {{-- 요약 카드 --}}
관리자 정보 수정
#{{ $admin->id ?? '-' }} / {{ $admin->email ?? '-' }}
← 목록
{{-- KV 그리드 --}}
상태
● {{ $statusLabel }} @if($st !== 'active') (로그인 불가) @endif
계정 잠금
@if($isLocked) ● 잠김
{{ $admin->locked_until }}
@else ● 정상
※ 3회 실패 시 잠김
@endif
로그인 실패 횟수
{{ (int)($admin->failed_login_count ?? 0) }}
최근 로그인 IP
{{ $ip }}
최근 로그인 시간
{{ $admin->last_login_at ?? '-' }}
2FA
@if($hasSecret) OTP 등록됨 @else OTP 미등록 @endif 현재모드: {{ $isModeOtp ? 'OTP' : 'SMS' }}
생성
{{ $admin->created_at ?? '-' }}
최근 수정
{{ $admin->updated_at ?? '-' }}
비활성 처리자
{{ $admin->deleted_by ?? '-' }}
현재 역할
@forelse($roles as $rr) {{ $rr['name'] ?? ($rr['code'] ?? '-') }} @empty - @endforelse
{{-- 수정 폼 --}}
@csrf
※ 저장 시 phone_hash + phone_enc 갱신
@if(!$hasSecret)
※ OTP 미등록 상태라 선택할 수 없습니다. (등록은 ‘내 정보’에서만 가능)
@endif
여러 개 선택 가능
@foreach($allRoles as $r) @php $rid = (int)$r['id']; @endphp @endforeach
{{-- 하단 액션바 --}}
← 뒤로가기
@if(!empty($admin->locked_until))
@csrf
@endif
@csrf
@endsection