@extends('layouts.admin') @section('title', isset($user) ? '編輯帳號' : '新增帳號') @section('content')
@csrf @if(isset($user)) @method('PUT') @endif
@if(isset($user))

登入帳號建立後不可修改

@else @endif

需 8 字元以上,包含大小寫字母、數字及特殊符號

留空表示帳號永不到期

@php $userCategoryIds = old('category_ids', isset($user) ? $user->examCategories->pluck('id')->toArray() : []); @endphp

不勾選 = 不限制(可看到所有考試)。勾選後,該使用者只能看到所選類別及其子類別的考試。

@foreach($examCategories as $root)
@if($root->children->count() > 0)
@foreach($root->children as $child) @if($child->children->count() > 0) @foreach($child->children as $grandchild) @endforeach @endif @endforeach
@endif
@endforeach

安全選項

@if(isset($user) && $user->isLockedOut()) @endif
@if(isset($user))

安全資訊

最後登入
{{ $user->last_login_at ? $user->last_login_at->format('Y-m-d H:i') : '從未登入' }}
密碼變更日期
{{ $user->password_changed_at ? $user->password_changed_at->format('Y-m-d H:i') : '未設定' }}
密碼天數
{{ $user->passwordAgeDays() !== null ? $user->passwordAgeDays() . ' 天' : '-' }}
登入失敗次數
帳號狀態
@if($user->isLockedOut()) 鎖定中(至 {{ $user->locked_until->format('H:i') }}) @elseif(!$user->is_active) 已停用 @elseif($user->isAccountExpired()) 已到期 @elseif($user->password_expired_disabled) 密碼逾期停用 @else 正常 @endif
建立日期
{{ $user->created_at->format('Y-m-d H:i') }}
@endif
取消
@endsection