From 945305b54be85c24cba56b38a5b0854c40d9d7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 5 Mar 2026 20:20:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[tenant]=20=ED=85=8C=EB=84=8C=ED=8A=B8?= =?UTF-8?q?=20=ED=8E=B8=EC=A7=91=EC=97=90=20=EC=9D=B8=EC=87=84=EC=9A=A9=20?= =?UTF-8?q?=ED=9A=8C=EC=82=AC=20=ED=91=9C=EC=8B=9C=EB=AA=85=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 테넌트 편집 페이지에 '인쇄용 회사명' 입력 필드 추가 - 저장 시 tenant_settings 테이블에 display_company_name 저장 - 재직증명서 등 문서에서 표시명 우선 적용 --- .../Controllers/Api/Admin/TenantController.php | 17 +++++++++++++++++ app/Http/Controllers/TenantController.php | 9 ++++++++- resources/views/tenants/edit.blade.php | 10 ++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/Admin/TenantController.php b/app/Http/Controllers/Api/Admin/TenantController.php index eeae104a..2a3a3496 100644 --- a/app/Http/Controllers/Api/Admin/TenantController.php +++ b/app/Http/Controllers/Api/Admin/TenantController.php @@ -5,6 +5,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\StoreTenantRequest; use App\Http\Requests\UpdateTenantRequest; +use App\Models\Tenants\TenantSetting; use App\Services\TenantService; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; @@ -104,6 +105,22 @@ public function update(UpdateTenantRequest $request, int $id): JsonResponse { $this->tenantService->updateTenant($id, $request->validated()); + // 인쇄용 회사 표시명 저장 (tenant_settings) + if ($request->has('display_company_name')) { + TenantSetting::withoutGlobalScopes()->updateOrCreate( + [ + 'tenant_id' => $id, + 'setting_group' => 'company', + 'setting_key' => 'display_company_name', + ], + [ + 'setting_value' => trim($request->input('display_company_name', '')), + 'description' => '문서에 인쇄되는 회사 표시명', + 'updated_by' => auth()->id(), + ] + ); + } + // HTMX 요청 시 성공 메시지와 리다이렉트 헤더 반환 if ($request->header('HX-Request')) { return response()->json([ diff --git a/app/Http/Controllers/TenantController.php b/app/Http/Controllers/TenantController.php index 3c23bfdd..b9ff4cc7 100644 --- a/app/Http/Controllers/TenantController.php +++ b/app/Http/Controllers/TenantController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Models\Tenants\TenantSetting; use App\Services\TenantService; use Illuminate\Http\Request; use Illuminate\Http\Response; @@ -45,7 +46,13 @@ public function edit(int $id): View abort(404, '테넌트를 찾을 수 없습니다.'); } - return view('tenants.edit', compact('tenant')); + $displayCompanyName = TenantSetting::withoutGlobalScopes() + ->where('tenant_id', $id) + ->where('setting_group', 'company') + ->where('setting_key', 'display_company_name') + ->first()?->setting_value ?? ''; + + return view('tenants.edit', compact('tenant', 'displayCompanyName')); } /** diff --git a/resources/views/tenants/edit.blade.php b/resources/views/tenants/edit.blade.php index 6f560adf..101f5561 100644 --- a/resources/views/tenants/edit.blade.php +++ b/resources/views/tenants/edit.blade.php @@ -34,6 +34,16 @@ +
+ + +

비워두면 회사명이 그대로 사용됩니다.

+