Files
sam-manage/resources/views/layouts/app.blade.php
hskwon f49cfd982a 테넌트 관리 기능 수정 및 ViewServiceProvider 변수명 충돌 해결
주요 변경사항:
- Spatie Laravel Permission 패키지 설치 (v6.23.0)
- admin 프로젝트에서 필수 Traits 및 Scopes 복사
  - ModelTrait, BelongsToTenant, HasTenantFilter, UppercaseAttributes
  - TenantScope
- Tenant 모델 관계 수정 (hasMany → belongsToMany via user_tenants)
- Tenant 모델 null 처리 추가 (status_label, created_at)
- Laravel 12 bootstrap/app.php에 API 라우트 등록
- API 라우트 미들웨어 수정 (auth:sanctum → web,auth)
- HTMX 라이브러리 및 CSRF 토큰 헤더 추가

ViewServiceProvider 수정:
- 전역 View Composer의 $tenants 변수를 $globalTenants로 변경
- 페이지별 페이지네이션된 $tenants 변수와의 충돌 방지
- tenant-selector.blade.php에서 $globalTenants 사용

버그 수정:
- Collection::hasPages() 오류 해결 (ViewComposer 변수 덮어쓰기 문제)
- 테넌트 목록 무한 로딩 스피너 해결
- 500 Internal Server Error 해결
2025-11-24 11:17:31 +09:00

32 lines
944 B
PHP

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>@yield('title', 'Dashboard') - {{ config('app.name') }}</title>
@vite(['resources/css/app.css', 'resources/js/app.js'])
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
@stack('styles')
</head>
<body class="bg-gray-100">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
@include('partials.sidebar')
<!-- Main Content Area -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Header -->
@include('partials.header')
<!-- Page Content -->
<main class="flex-1 overflow-y-auto bg-gray-100 p-6">
@yield('content')
</main>
</div>
</div>
@stack('scripts')
</body>
</html>