71 lines
2.8 KiB
PHP
71 lines
2.8 KiB
PHP
@extends('layout')
|
|
|
|
@section('main')
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h2>사용자 관리</h2>
|
|
<a href="{{ route('settings.users.create') }}" class="btn btn-primary">
|
|
+ 사용자 추가
|
|
</a>
|
|
</div>
|
|
|
|
@if(session('success'))
|
|
<div class="alert alert-success">{{ session('success') }}</div>
|
|
@endif
|
|
@if(session('error'))
|
|
<div class="alert alert-danger">{{ session('error') }}</div>
|
|
@endif
|
|
|
|
<div class="card shadow-sm">
|
|
<div class="card-body p-0">
|
|
<table class="table table-hover mb-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>이름</th>
|
|
<th>이메일</th>
|
|
<th>권한</th>
|
|
<th>가입일</th>
|
|
<th class="text-end">관리</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($users as $user)
|
|
<tr class="align-middle">
|
|
<td>{{ $user->name }}</td>
|
|
<td>{{ $user->email }}</td>
|
|
<td>
|
|
@if($user->is_admin)
|
|
<span class="badge bg-danger">관리자</span>
|
|
@else
|
|
<span class="badge bg-secondary">일반 회원</span>
|
|
@endif
|
|
</td>
|
|
<td>{{ $user->created_at->format('Y-m-d') }}</td>
|
|
<td class="text-end">
|
|
@if($user->id !== auth()->id())
|
|
<form action="{{ route('settings.users.promote', $user) }}" method="POST" class="d-inline">
|
|
@csrf
|
|
@method('PATCH')
|
|
@if($user->is_admin)
|
|
<button class="btn btn-sm btn-outline-warning">관리자 해제</button>
|
|
@else
|
|
<button class="btn btn-sm btn-outline-success">관리자 지정</button>
|
|
@endif
|
|
</form>
|
|
|
|
<form action="{{ route('settings.users.destroy', $user) }}" method="POST" class="d-inline" onsubmit="return confirm('정말 삭제하시겠습니까?');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button class="btn btn-sm btn-outline-danger">삭제</button>
|
|
</form>
|
|
@else
|
|
<span class="text-muted small me-2">(본인)</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endsection
|