From 0f214459ddd839b19d6bc8167d89459cd606e661 Mon Sep 17 00:00:00 2001 From: hskwon Date: Fri, 21 Nov 2025 15:00:30 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Phase=204-1=20=ED=85=8C=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EA=B4=80=EB=A6=AC=20=ED=94=84=EB=A1=A0=ED=8A=B8?= =?UTF-8?q?=EC=97=94=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 라우트 등록 (web.php: Blade 화면, api.php: HTMX API) - Blade 뷰 생성 (index, create, edit) - Partial 템플릿 생성 (table with pagination) - HTMX 통합 (비동기 CRUD, 필터링, 페이지네이션) - Pure Tailwind CSS 스타일링 - 실시간 검색 및 상태 필터 - 삭제/복원 기능 구현 --- resources/views/tenants/create.blade.php | 192 +++++++++++++++ resources/views/tenants/edit.blade.php | 218 ++++++++++++++++++ resources/views/tenants/index.blade.php | 110 +++++++++ .../views/tenants/partials/table.blade.php | 148 ++++++++++++ routes/api.php | 30 +++ routes/web.php | 9 +- 6 files changed, 706 insertions(+), 1 deletion(-) create mode 100644 resources/views/tenants/create.blade.php create mode 100644 resources/views/tenants/edit.blade.php create mode 100644 resources/views/tenants/index.blade.php create mode 100644 resources/views/tenants/partials/table.blade.php create mode 100644 routes/api.php diff --git a/resources/views/tenants/create.blade.php b/resources/views/tenants/create.blade.php new file mode 100644 index 00000000..6df94dff --- /dev/null +++ b/resources/views/tenants/create.blade.php @@ -0,0 +1,192 @@ +@extends('layouts.app') + +@section('title', '테넌트 생성') + +@section('content') +
+ +
+

테넌트 생성

+ + ← 목록으로 + +
+ + +
+
+ + +
+

기본 정보

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+

회사 정보

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+

구독 정보

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+

관리자 메모

+ +
+ + +
+ + 취소 + + +
+
+
+
+@endsection + +@push('scripts') + + +@endpush \ No newline at end of file diff --git a/resources/views/tenants/edit.blade.php b/resources/views/tenants/edit.blade.php new file mode 100644 index 00000000..6e5ae4b0 --- /dev/null +++ b/resources/views/tenants/edit.blade.php @@ -0,0 +1,218 @@ +@extends('layouts.app') + +@section('title', '테넌트 수정') + +@section('content') +
+ +
+

테넌트 수정

+ + ← 목록으로 + +
+ + +
+
+ + +
+

기본 정보

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+

회사 정보

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+

구독 정보

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+

관리자 메모

+ +
+ + +
+

통계

+
+
+
{{ $tenant->users_count ?? 0 }}
+
사용자
+
+
+
{{ $tenant->departments_count ?? 0 }}
+
부서
+
+
+
{{ $tenant->menus_count ?? 0 }}
+
메뉴
+
+
+
{{ $tenant->roles_count ?? 0 }}
+
역할
+
+
+
+ + +
+ + 취소 + + +
+
+
+
+@endsection + +@push('scripts') + + +@endpush \ No newline at end of file diff --git a/resources/views/tenants/index.blade.php b/resources/views/tenants/index.blade.php new file mode 100644 index 00000000..eebf8b97 --- /dev/null +++ b/resources/views/tenants/index.blade.php @@ -0,0 +1,110 @@ +@extends('layouts.app') + +@section('title', '테넌트 관리') + +@section('content') +
+ +
+

테넌트 관리

+ + + 새 테넌트 + +
+ + +
+
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+
+ + +
+ +
+
+
+
+
+@endsection + +@push('scripts') + + +@endpush \ No newline at end of file diff --git a/resources/views/tenants/partials/table.blade.php b/resources/views/tenants/partials/table.blade.php new file mode 100644 index 00000000..b844aec7 --- /dev/null +++ b/resources/views/tenants/partials/table.blade.php @@ -0,0 +1,148 @@ +
+ + + + + + + + + + + + + + + + + + + @forelse($tenants as $tenant) + + + + + + + + + + + + + + + @empty + + + + @endforelse + +
ID회사명코드상태이메일전화번호사용자부서메뉴역할생성일액션
+ {{ $tenant->id }} + +
{{ $tenant->company_name }}
+ @if($tenant->ceo_name) +
대표: {{ $tenant->ceo_name }}
+ @endif +
+ {{ $tenant->code }} + + + {{ $tenant->status_label }} + + + {{ $tenant->email ?? '-' }} + + {{ $tenant->phone ?? '-' }} + + {{ $tenant->users_count ?? 0 }} + + {{ $tenant->departments_count ?? 0 }} + + {{ $tenant->menus_count ?? 0 }} + + {{ $tenant->roles_count ?? 0 }} + + {{ $tenant->created_at->format('Y-m-d') }} + + @if($tenant->deleted_at) + + + @if(auth()->user()?->is_super_admin) + + @endif + @else + + + 수정 + + + @endif +
+ 등록된 테넌트가 없습니다. +
+
+ + +@if($tenants->hasPages()) +
+
+
+ @if($tenants->onFirstPage()) + + 이전 + + @else + + @endif + + @if($tenants->hasMorePages()) + + @else + + 다음 + + @endif +
+ +
+
+@endif \ No newline at end of file diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 00000000..80f7813e --- /dev/null +++ b/routes/api.php @@ -0,0 +1,30 @@ +prefix('admin')->name('api.admin.')->group(function () { + + // 테넌트 관리 API + Route::prefix('tenants')->name('tenants.')->group(function () { + Route::get('/', [TenantController::class, 'index'])->name('index'); + Route::post('/', [TenantController::class, 'store'])->name('store'); + Route::get('/{id}', [TenantController::class, 'show'])->name('show'); + Route::put('/{id}', [TenantController::class, 'update'])->name('update'); + Route::delete('/{id}', [TenantController::class, 'destroy'])->name('destroy'); + + // 추가 액션 + Route::post('/{id}/restore', [TenantController::class, 'restore'])->name('restore'); + Route::delete('/{id}/force', [TenantController::class, 'forceDestroy'])->name('forceDestroy'); + Route::get('/stats', [TenantController::class, 'stats'])->name('stats'); + }); +}); \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 9628af06..497ec248 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,7 +27,14 @@ // 테넌트 전환 Route::post('/tenant/switch', [TenantController::class, 'switch'])->name('tenant.switch'); - // 대시보드 (임시) + // 테넌트 관리 (Blade 화면만) + Route::prefix('tenants')->name('tenants.')->group(function () { + Route::get('/', [TenantController::class, 'index'])->name('index'); + Route::get('/create', [TenantController::class, 'create'])->name('create'); + Route::get('/{id}/edit', [TenantController::class, 'edit'])->name('edit'); + }); + + // 대시보드 Route::get('/dashboard', function () { return view('dashboard.index'); })->name('dashboard');